guillaume ORIOL wrote:
> I've got a servlet which redirects the user to an HTML page under certain
> circumstances. The servlet executes properly and then attempts to redirect
> the user
> to the html page. I receive the error "Internal server error" and the jserv
> log says:
> [14/06/1999 09:13:05:408 GMT+02:00] java.io.FileNotFoundException:
> /loginpage.html (File not found)
> at java.io.FileInputStream.open(Native Method)
> at java.io.FileInputStream.<init>(FileInputStream.java:68)
> at Relais._performAction(Compiled Code)
> at Relais.service(Relais.java:186)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
> at org.apache.jserv.JServConnection.run(JServConnection.java:359)
> at java.lang.Thread.run(Thread.java:479)
>
You didn't include the code fragment from your servlet that is actually doing
the redirect (in the Relais._performAction method according to your stack
trace), so some of the below is guessing what you might be doing. But it looks
like you are trying to open the file itself inside your servlet, instead of
sending a response.sendRedirect() message. If that is the case, you can use
the following code to get the actual pathname of the file:
String pathname = getServletContext().getRealPath("/mypage.html");
NOTE: This will not get the right answer if you are using aliasing rules
inside Apache to redirect where the page actually lives, due to a current
restriction in Apache JServ.
Craig McClanahan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html