Fórum

redirect when user logged in

thumbnail
Anil T, modificado 9 Anos atrás.

redirect when user logged in

Expert Postagens: 313 Data de Entrada: 14/01/12 Postagens Recentes
Hi Team,

I am developing a custom login spring portlet which will be placed in the signin page. Now have got success with the authentication and have to redirect it to home page from the process action and render method.

I have 2 scenarios. One is when user authenticated then it should redirect to home page and second one is when user logged in and access the signin page then in this case also should redirect to home page.

I have seen from the forums and tried by sendredirect method and spring's redirect: something like this but not working for me any code snippet.

I am using the send redirect method in the process action but not working. Could anyone tell how to redirect it from the both phases render and process action ?


Thanks,
Anil T
thumbnail
Anil T, modificado 9 Anos atrás.

RE: redirect when user logged in

Expert Postagens: 313 Data de Entrada: 14/01/12 Postagens Recentes
Hi,

I am able to redirect now with javascript but need to redirect from portlet lifecycle methods. Please provide some solution for this kind of requirement.

Thanks,
Anil T
Sharad Sinha, modificado 9 Anos atrás.

RE: redirect when user logged in

Junior Member Postagens: 44 Data de Entrada: 08/03/13 Postagens Recentes
Hi Anil,
You can go with a hook which will redirect your user to his homepage.

Thanks
Sharad Sinha
thumbnail
Anil T, modificado 9 Anos atrás.

RE: redirect when user logged in

Expert Postagens: 313 Data de Entrada: 14/01/12 Postagens Recentes
Hi,

My portlet is custom portlet and could you tell me how user will redirect to home page ? Do you have any code snippet ?

Thanks,
Anil T
Devi Nimmagadda, modificado 9 Anos atrás.

RE: redirect when user logged in

New Member Postagens: 23 Data de Entrada: 05/07/13 Postagens Recentes
Hi Anil,

Try the below code :

response.sendRedirect("/web/guest/home");

It worked for me..
thumbnail
Anil T, modificado 9 Anos atrás.

RE: redirect when user logged in

Expert Postagens: 313 Data de Entrada: 14/01/12 Postagens Recentes
Hi Devi,

It is working for me in process action method but I too need to redirect from the render method also. Do you have any idea how to redirect from the render method. I have tried to convert render request to httpservlet request and called the sendRedirect method but did not get success.

Thanks,
Anil T
thumbnail
Anil Sunkari, modificado 9 Anos atrás.

RE: redirect when user logged in

Expert Postagens: 427 Data de Entrada: 12/08/09 Postagens Recentes
Anil T:
Hi Team,

I am developing a custom login spring portlet which will be placed in the signin page. Now have got success with the authentication and have to redirect it to home page from the process action and render method.

I have 2 scenarios. One is when user authenticated then it should redirect to home page and second one is when user logged in and access the signin page then in this case also should redirect to home page.

I have seen from the forums and tried by sendredirect method and spring's redirect: something like this but not working for me any code snippet.

I am using the send redirect method in the process action but not working. Could anyone tell how to redirect it from the both phases render and process action ?


Thanks,
Anil T


Anil,

For this purpose we can go with hook.By customizing the PostLoginAction class.Please have a look in forums about this in deep.