Foros de discusión
redirect after Login
Beppo Ivel, modificado hace 9 años.
redirect after Login
Regular Member Mensajes: 112 Fecha de incorporación: 9/04/14 Mensajes recientes
Hi.
I followed this tutorial. My question is, how to change the "render" method that after the "Admin" is logged in it redirects to the page "terms_of_use.jsp"?
I followed this tutorial. My question is, how to change the "render" method that after the "Admin" is logged in it redirects to the page "terms_of_use.jsp"?
public String render(StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig, RenderRequest renderRequest,
RenderResponse renderResponse) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
Long currentuser = themeDisplay.getUserId();
User user = UserLocalServiceUtil.getUser(currentuser);
if (user.getLastName().equals("Admin")) {
return "/portal/terms_of_use.jsp";
}
System.out.println("Wrapped /login/ action");
return originalStrutsPortletAction.render(null, portletConfig, renderRequest, renderResponse);
}