Re: Problems with 3.1.0

Splash Forums PrettyFaces Users Problems with 3.1.0 Re: Problems with 3.1.0

#20465

It seems like the dynaview is not working correctly if you are using an extension-based mapping for the FacesServlet. That’s very strange. Could you try to use .xhtml instead of .jsf in your dynaview? Perhaps this will help.

Regarding your login page: You could either save the original URL by writing it to a query parameter or you could temporarily save it in the session. I personally would prefer the first option. This would look something like this:

<url-mapping id="login">
<pattern value="/login">
<query-param name="url"> #{loginBean.redirectUrl} </query-param>
</url-mapping>

In your UrlBean:

public String getSiteCase() {
if (loggedIn) {

// ..

} else {

// set value of the query parameter
loginBean.setRedirectUrl( request.getRequestURI() );

// perform the redirect. The query parameter value will
// be read from the loginBean
return "pretty:login";

}

This way you will have the correct URL in the LoginBean and can directly send a redirect in case of a successful login.

Here are some relevant references to the documentation regarding this:

http://ocpsoft.com/docs/prettyfaces/3.1.0/en-US/html/Configuration.html#config.queryparams

http://ocpsoft.com/docs/prettyfaces/3.1.0/en-US/html/navigation.html#navigation.actions