Reply To: Get context url from pretty-url

Splash Forums Rewrite Users Get view-id from arbitrary pretty-url Reply To: Get context url from pretty-url

#24689

Hey there,

Sorry for the slow response. I believe this is what you are looking for:

https://github.com/ocpsoft/rewrite/issues/100

To get “URL” you have to use:

request.getAttribute("javax.servlet.forward.request_uri")
The Servlet 3.1 spec says:

The following request attributes must be set:

javax.servlet.forward.request_uri
javax.servlet.forward.context_path
javax.servlet.forward.servlet_path
javax.servlet.forward.path_info
javax.servlet.forward.query_string

However, if you want the back button to work, make sure that all of your JSF navigation uses ?faces-redirect=true – then the browser’s back button will work normally without the need for enhancement.