-
1. Re: regarding Redirect.captureCurrentView()
atao Sep 10, 2007 4:42 AM (in response to mnrz)Redirect.instance().captureCurrentView() works with the viewId of the required view. See login pages in seam-gen to get the idea.
You need to use a page parameter. See (in french): http://wiki.objetdirect.com/wiki/index.php?title=Navigation_avec_Seam -
2. Re: regarding Redirect.captureCurrentView()
mnrz Sep 10, 2007 5:10 AM (in response to mnrz)as I read in javadoc it is stated:
captureCurrentView():
Capture the view id and page parameters from the current request and squirrel them away so we can return here later in the conversation.
and
returnToCapturedView():
Redirect to the captured view, and end any conversation that began in captureCurrentView().
I think it should work as they described -
3. Re: regarding Redirect.captureCurrentView()
atao Sep 10, 2007 6:21 AM (in response to mnrz)
I think it should work as they described
In fact it does. But I needed some times before to get it: the key words are "current request". The viewId is the one of the request, i.e. of the required view, not of the requiring view.
You can switch from the current request to a new one and then come back to this request, but not to the point which raised this request.
Login in seam-gen is a good example to get it. -
4. Re: regarding Redirect.captureCurrentView()
mnrz Sep 10, 2007 7:26 AM (in response to mnrz)well, I checked the seam-gen but its login page and its authenticator is very simple without any use of "Redirect". could you give me the file name you are meant?
-
5. Re: regarding Redirect.captureCurrentView()
atao Sep 10, 2007 9:41 AM (in response to mnrz)In application generated by seam-gen, there is in components.xml:
<event type="org.jboss.seam.notLoggedIn"> <action expression="#{redirect.captureCurrentView}"/> </event> <event type="org.jboss.seam.postAuthenticate"> <action expression="#{redirect.returnToCapturedView}"/> </event>
and in pages.xml:<exception class="org.jboss.seam.security.NotLoggedInException"> <redirect view-id="/login.xhtml"> <message>#{messages['org.jboss.seam.security.NotLoggedInException']}</message> </redirect> </exception>
The event org.jboss.seam.notLoggedIn is raised by Pages.notLoggedIn which is called by Pages.redirectToLoginView just before going to the Login view.
And the event org.jboss.seam.postAuthenticate is raised by Identity.postAuthenticate