掲示板

Auto redirect to welcome page if user already logged in

7年前 に Sign Shah によって更新されました。

Auto redirect to welcome page if user already logged in

New Member 投稿: 6 参加年月日: 16/03/31 最新の投稿
I have developed a portlet in Liferay using JSF. As I don't want to use LifeRay login, I have my own login portlet deployed in liferay.

Now the problem is after login whenever I refresh page it again go back to the login portlet which is login.xhtml. My LoginBean is in session scope. How can I send user automatically to the welcome page if he is already logged in?

I tried to use the below thing but it doesn't work. Even no error. But it shows login page again. I also tried to call a action while page loading during login page load and run the below code but it is running successfully but not redirecting to the welcome page.

FacesContext fc = FacesContext.getCurrentInstance();
NavigationHandler navigationHandler = fc.getApplication().getNavigationHandler();
navigationHandler.handleNavigation(fc, null, "welcome");
fc.renderResponse();


I have navigation rule in the faces-config.xml (Liferay 6.2)

Thank you...
thumbnail
7年前 に Philip White によって更新されました。

RE: Auto redirect to welcome page if user already logged in (回答)

Junior Member 投稿: 76 参加年月日: 15/03/11 最新の投稿
Hi Sign Shah,

Please look at our jsf2-login-portlet demo.

A binary version can be downloaded here.

Regarding your question about navigation, we have a "You are signed in as ..." type of feature using Facelet's JSTL.

Finally, this only works on Liferay 6.2 + Tomcat 7.

Hope this helps!

Phil
thumbnail
7年前 に Neil Griffin によって更新されました。

Moved to Liferay Faces - English

Liferay Legend 投稿: 2655 参加年月日: 05/07/27 最新の投稿
Moved to Liferay Faces - English