I am using PrettyFaces in my JSF application. The site requires authentication to access some pages, so I use a listener (prerender view) that checks if the user is logged in. That way, if the user tries to access / foo (/foo.jsf before PrettyFaces), I redirect to login.
However, I want to redirect them to my original address, so I want to add the "next" request parameter to redirect the user to / login instead? next = / foo. Unfortunately, I cannot get the original uri request from the request object, the uri string in the following code: /appname/foo.jsf instead of / appname / foo
ctx = FacesContext.getCurrentInstance().getExternalContext(); HttpServletRequest request = (HttpServletRequest) ctx.getRequest(); String uri = request.getRequestURI();
Is there any way to get the source path of the URI?
ustun
source share