Re: Rewrite every *.jsf

Splash Forums PrettyFaces Users Rewrite every *.jsf Re: Rewrite every *.jsf

#20597

mraible
Participant

The following processor works, but my app still shows .jsf on URLs in my browser, which is what I’m trying to get rid of:

public class UrlProcessor implements Processor {

public String process(RewriteRule rule, String url) {

if (url.contains(“/images”) || url.contains(“/styles”) || url.contains(“/scripts”) ||

url.contains(“/login”) || url.contains(“/logout”) || url.contains(“/j_security_check”)

|| url.equals(“/”)) {

return url;

} else if (!url.contains(“.jsf”)) {

return url + “.jsf”;

} else {

return url;

}

}

}

My pretty-config.xml is as follows, but it seems the final one gets hit everytime, even for /login.

<url-mapping>

<pattern value=”/login” />

<view-id value=”/login.jsp” />

</url-mapping>

<url-mapping>

<pattern value=”/logout” />

<view-id value=”/logout.jsp” />

</url-mapping>

<rewrite processor=”org.appfuse.webapp.util.UrlProcessor” inbound=”true”/>