Re: How to do POST-REDIRECT-GET after action with PrettyFaces ?

Splash Forums PrettyFaces Users How to do POST-REDIRECT-GET after action with PrettyFaces ? Re: How to do POST-REDIRECT-GET after action with PrettyFaces ?

#21937

appatogma
Member

This portion of code is in web.xml

===================================

<filter>

<filter-name>Pretty Filter</filter-name>

<filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>

<async-supported>true</async-supported>

</filter>

<filter-mapping>

<filter-name>Pretty Filter</filter-name>

<url-pattern>/*</url-pattern>

<dispatcher>FORWARD</dispatcher>

<dispatcher>REQUEST</dispatcher>

<dispatcher>ASYNC</dispatcher>

<dispatcher>ERROR</dispatcher>

</filter-mapping>


pretty-config.xml

==================================

<?xml version=’1.0′ encoding=’UTF-8′?>

<!– =========== FULL CONFIGURATION FILE ================================== –>

<pretty-config xmlns=”http://ocpsoft.org/prettyfaces/3.3.3″

xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”

xsi:schemaLocation=”http://ocpsoft.org/prettyfaces/3.3.3 http://ocpsoft.org/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.3.xsd“>

<url-mapping id=”setup”>

<pattern value=”/setup/” />

<view-id value=”/faces/setup/scheme-list.xhtml”/>

</url-mapping>

<url-mapping id=”category”>

<pattern value=”/category/” />

<view-id value=”/faces/faq/categoryList.xhtml”/>

</url-mapping>

<url-mapping id=”version”>

<pattern value=”/version” />

<view-id value=”/faces/faq/createVersion.xhtml”/>

</url-mapping>

<url-mapping id=”user”>

<pattern value=”/user/” />

<view-id value=”/faces/administrator/viewAdminUser.xhtml”/>

</url-mapping>

<url-mapping id=”mobileUser”>

<pattern value=”/mobileUser/” />

<view-id value=”/faces/usersession/viewUserSession.xhtml”/>

</url-mapping>

<url-mapping id=”home”>

<pattern value=”/home/”/>

<view-id value=”/faces/process/generate-returns.xhtml”/>

</url-mapping>

<url-mapping id=”login”>

<pattern value=”/login/” />

<view-id value=”/faces/index.xhtml”/>

</url-mapping>

</pretty-config>


LoginMBean.java

=========================

public String homePage() {

return “pretty:home”;

}

public String userInitiatelogout() {

FacesContext.getCurrentInstance().getExternalContext().invalidateSession();

FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_INFO, “Logout Request”, “User successfully logout”);

FacesContext.getCurrentInstance().addMessage(null, facesMessage);

return “pretty:login”;

}

…….

…….

…….

The pages navigate correctly. But the challenge experienced here is that when I log out and log in again the pages I have prior visited holds the old values. Investigation shows that this is possible only when pages forward to other pages. But this would not have been if pages redirect. PrettyFaces controls the navigations on my entire application.

Did I miss anything in my configuration above?

Kindly advise.

Regards