Reply To: Rewrite Rules when using with ADF/Webcenter

Splash Forums PrettyFaces Users Rewrite Rules when using with ADF/Webcenter Reply To: Rewrite Rules when using with ADF/Webcenter

#27035

Siddharth
Participant

Hi Lincoln ,

I tried to integrate Rewrite with my sample app and using following rule.

        return ConfigurationBuilder.begin()
            .addRule(Join.path("/mylifeportal/{p}")
                     .to("/faces/{p}"))
            .where("p").matches(".*")
            ;

so my URL becomes http://127.0.0.1:7101/prettyRewrite/mylifeportal/Main.jspx?_adf.ctrl-state=heqobfqb3_4&_afrLoop=16871011112338 . which is fine .

But if i remove all the params and hit enter , the URL becomes :

http://127.0.0.1:7101/prettyRewrite/mylifeportal/Main.jspx?p=Main.jspx&p=Main.jspx&p=Main.jspx&p=Main.jspx&_afrWindowMode=0&_afrLoop=16935526785590&_adf.ctrl-state=heqobfqb3_24

Rewrite adds many params in the URL .How can i stop this ?

Other issue is If I have a page like “New Page” with a space in the middle , i get the following error

java.lang.IllegalArgumentException: [/prettyRewrite/faces/New Page?p=New+Page&p=New+Page&p=New+Page&p=New+Page&_afrWindowId=llz5etwak_21&_afrWindowMode=0&_afrLoop=16457928559785&_adf.ctrl-state=llz5etwak_29] is not a valid URL fragment. Consider encoding relevant portions of the URL with [class org.ocpsoft.urlbuilder.util.Encoder]
	at org.ocpsoft.urlbuilder.AddressBuilder.create(AddressBuilder.java:89)
	at org.ocpsoft.rewrite.servlet.impl.HttpRewriteWrappedResponse.encodeURL(HttpRewriteWrappedResponse.java:396)
	at javax.servlet.http.HttpServletResponseWrapper.encodeURL(HttpServletResponseWrapper.java:86)
	at com.sun.faces.context.ExternalContextImpl.encodeActionURL(ExternalContextImpl.java:375)

Full stack trace is attached .

I tried by replacing space with %20 but still no luck . Kindly suggest .

Regards,
Siddharth