-
1. Re: Redirecting page after authentication
lvdberg Sep 22, 2010 8:00 AM (in response to kamiq)Hi,
Try this:
<page view-id="login.xhtml"> <navigation from-action="#{identity.login}"> <rule if-outcome="loggedIn"> <redirect view-id="home.xhtml" /> </rule> </navigation> .... </page>
You call the action from your log-in page and the authenticator should be configured as usual in components.xml
Leo
-
2. Re: Redirecting page after authentication
marcelkolsteren Sep 22, 2010 8:14 AM (in response to kamiq)Leo already described how to redirect to your home page after successful login. Then there still is the part of redirecting to the home page after session expiration. You could do that by adding this to your pages.xml file:
<exception class="javax.faces.application.ViewExpiredException" log="false"> <redirect view-id="/home.xhtml"> <message severity="warn">#{messages['warn.viewExpired']}</message> </redirect> </exception>
-
3. Re: Redirecting page after authentication
marcelkolsteren Sep 22, 2010 8:18 AM (in response to kamiq)Sorry, forget my remark :-). After session expiration you'd probably want to redirect to the login page, instead of the home page. You probably already have that fragment for handling the ViewExpiredException in pages.xml, but with a redirect to login.xhtml instead of home.xhtml.
-
4. Re: Redirecting page after authentication
kamiq Sep 22, 2010 8:52 AM (in response to kamiq)Thanks for your interest.
Unfortunately it doesn't work as I expect. I have been using this configuration from the beginning. maybe I described wrong my problem, and following example wiil be more preciseFor example, if I click something on page when the session is expired, application redirects me to login...it's correct. But after authentication I'm redirected to previous page (where I clicked something) instead of home page (I expect always ). I don't undarstand where this old url is cached. Any ideas?
I use seam 2.2 version.
-
5. Re: Redirecting page after authentication
marcelkolsteren Sep 22, 2010 9:11 AM (in response to kamiq)Redirecting back to the requested page after a login interruption is normally done by adding these event actions to the components.xml:
<event type="org.jboss.seam.security.notLoggedIn"> <action execute="#{redirect.captureCurrentView}"/> </event> <event type="org.jboss.seam.security.postAuthenticate"> <action execute="#{redirect.returnToCapturedView}"/> </event>
Do you have those in components.xml? Then you need to remove them.
-
6. Re: Redirecting page after authentication
kamiq Sep 22, 2010 9:42 AM (in response to kamiq)Thanks Marcel,
This is exactly what I was looking for. Propably JBoss Tools generated this code snippet and I didn't see it.