Re: Redirect before/during page load

Splash Forums PrettyFaces Users Redirect before/during page load Re: Redirect before/during page load

#22172

DRY2
Participant

Thank you Christian. Using PrettyFaces page action solved my problem. Below was the code used.

// index page mapping inside pretty config

<url-mapping id=”home”>

<pattern value=”/” />

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

<action>#{siteTasks.prettyRedirectCity}</action>

</url-mapping>

// redirect method

public String prettyRedirectCity() {

if(!getCookie(“defaultCity”).equalsIgnoreCase(“null”)){

city = getCookie(“defaultCity”);

updateStateParam();

return “pretty:city”;

}else{

return null;

}

}