Buenas Roberto,
No sé si ya lo habrás mirado, pero Liferay ofrece por defecto una clase que es muy parecido a lo que tú quieres hacer, salvo que el comportamiento es para todos los usuarios el mismo (mientras que el tuyo depende del usuario).
La clase es DefaultLandingPageAction.java en portal-impl/src/com/liferay/portal/events.
La lógica que tiene es:
1
2 protected void doRun(
3 HttpServletRequest request, HttpServletResponse response)
4 throws Exception {
5
6 long companyId = PortalUtil.getCompanyId(request);
7
8 String path = PrefsPropsUtil.getString(
9 companyId, PropsKeys.DEFAULT_LANDING_PAGE_PATH);
10
11 if (_log.isInfoEnabled()) {
12 _log.info(
13 PropsKeys.DEFAULT_LANDING_PAGE_PATH + StringPool.EQUAL + path);
14 }
15
16 if (Validator.isNotNull(path)) {
17 LastPath lastPath = new LastPath(StringPool.BLANK, path);
18
19 HttpSession session = request.getSession();
20
21 session.setAttribute(WebKeys.LAST_PATH, lastPath);
22 }
Como ves, no hace ningún redirect, simplemente setea en la request el atributo WebKeys.LAST_PATH con el objeto LastPath que se genera en función de lo que se define en esta propiedad del portal.properties:
##
## Default Landing Page
##
#
# Set the default landing page path for logged in users relative to the
# server path. This is the page users are automatically redirected to after
# logging in. For example, if you want the default landing page to be
# http://localhost:8080/web/guest/login, set this to /web/guest/login. To
# activate this feature, set auth.forward.by.last.path to true. To customize
# the behavior, see com.liferay.portal.events.DefaultLandingPageAction in
# the "login.events.post" property above.
#
default.landing.page.path=
#default.landing.page.path=/web/guest/login
Comprueba que tus métodos UtilUrls.generaLasthPath devuelven un objeto LastPath y que se crean con la siguiente url (como se indica en el portal.properties) "/web/guest/login"
Un saludo
Por favor, faça login para denunciar.