0

I provide my user an URL: http://foo/show.jsf?id=1

However when the user is not logged in I throw an SecurityException and in my web.xml I define the errorPage für this exception to be login.jsf.

Now the user sees the login.jsf but the URL still looks like this: http://foo/show.jsf?id=1

After login I want to redirect my user to show.jsf (or whatever original url was specified). But in order to do this, I would need to somehow get the original request URL. Is it possible to get this URL somehow?

Thanks

matthias
  • 1,938
  • 23
  • 51
  • Where you throw your exception (using a filter to authenticate?) you have to somehow save the original requested URL via `HttpServletRequest#getRequestURI()` and redirect afterwards. – Smutje Nov 26 '15 at 08:58
  • well yes, a filter throws the exception. Can I redirect within a filter? – matthias Nov 26 '15 at 09:06

0 Answers0