Hi,

In the security framework I'm developing now, I allow the user to
specify to which URL he wants to forward the request in case there is an
access error to a secured servlet/JSP. I have been able to forward
requests to dynamic resources (servlets/JSP) with
getServletContext().getRequestDispatcher(redirectUrl).forward(request,response)
and evrything works fine. My problem is that I also want to allow the
user to specify an static html page so he can create
LogoutSuccessful.html, AccessDenied.html, ... and let the requests be
redirected to those pages. However I haven't been able to transparently
redirect requests to static URL's:
.- getServletContext().getResource(redirectUrl) always returns null,
I've even tried with "/", "/index.html", ... and nothing changes. It
always answers null.
.- getServletContext().getRequestDispatcher(redirectUrl) throws a
servlet exception telling me that no mapping was found for redirectUrl.
I guess it tells me so because the redirectURL is, in this case, neither
a servlet nor a JSP page.
.- I can use "new URL(redirectUrl).openStream()..." but then the URL has
to specify a complete URL, and if the host is not the same the relative
links are broken, so it's not really a solution.

If I can get the base URL for the host I'm running at, that would be
enough. But it would be nice to be able to redirect requests to any
given URL.
I'm using JRun 2.3.2 Build 151, in case that matters. I've read that
RequestDispatcher's behavious might depend on the servlet engine
implementation so that might be the problem.
Any help would be really appreciated,
Thanks in advance,
Dan
-------------------------------------------
Daniel Lopez Janariz ([EMAIL PROTECTED])
Web Services
Computer Center
Balearic Islands University
-------------------------------------------

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to