Re: how to hide all the suffix of the url

Splash Forums PrettyFaces Users how to hide all the suffix of the url Re: how to hide all the suffix of the url

#21873

Which version of PrettyFaces are you using?

You should perhaps try to avoid getting the URL from the PrettyContext and instead use a path parameter. Something like this:

<url-mapping id="global">
<pattern value="/#{ /.*/ bean.url }" />
<view-id> #{bean.getViewPath} </view-id>
</url-mapping>

@Named("bean")
@RequestScoped
public class Bean {

private String url;

public String getViewPath() {
if(url.endsWith(".xhtml") return url;
else return url + ".xhtml";
}

/* getter + setter */

}