@Override
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception {
Context context = UIUtil.obtainContext(request);
EPerson currUser = context.getCurrentUser();
if (currUser == null)
{
throw new ServletException("Wrong data or configuration: access to the my rp servlet without a valid user: there is no user logged in or the user's netid is null");
}
if (AuthorizeManager.isAdmin(context))
{
response.sendRedirect(request.getContextPath()+ "/dspace-admin/");
}
else
{
Integer id = currUser.getID();
ResearcherPage rp = applicationService.getResearcherPageByEPersonId(id);
if (rp != null && rp.getStatus() != null && rp.getStatus().booleanValue())
{
response.sendRedirect(request.getContextPath() + "/rp/" + ResearcherPageUtils.getPersistentIdentifier(rp));
}