留言板
Auto redirect to welcome page if user already logged in
Sign Shah,修改在7 年前。
Auto redirect to welcome page if user already logged in
New Member 帖子: 6 加入日期: 16-3-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...
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...
Philip White,修改在7 年前。
RE: Auto redirect to welcome page if user already logged in (答复)
Junior Member 帖子: 76 加入日期: 15-3-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
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