Home > Archive > Java Help > April 2005 > Redirecting error page 404...
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Redirecting error page 404...
|
|
| Tom Vercauteren via JavaKB.com 2005-04-26, 4:02 pm |
| Hi,
i try to make an error page with jsp on a tomcat 5.
Everything is ok, but i only want to show the name of the URL the user has
typed and isn't found.
The code in my jsp is a very simple html page and the part where i show the
url is the following ... :
The resource you are trying to reach, <%= request.getRequestURL()%>,
does not exist on this server.
But when my errorpage shows, i get the name of the error page, not the url
the user has used...
The user types : http://localhost/mytestapp/guess.jsp
and the message shown by the browser = The resource you are trying to
reach, http://localhost/mytestapp/filenotfound.jsp
does not exist on this server.
Anyone any suggestion?
Thank you very much.
Greets,
Tom
PS : i'm using jdk 1.4 & eclipse 3.0
--
Message posted via http://www.javakb.com
| |
| Tor Iver Wilhelmsen 2005-04-27, 4:01 pm |
| "Tom Vercauteren via JavaKB.com" <forum@nospam.JavaKB.com> writes:
> But when my errorpage shows, i get the name of the error page, not the url
> the user has used...
Correct, that is stored in a different attribute as per the spec:
(String) request.getAttribute("javax.servlet.error.request_uri");
See http://servlets.com/soapbox/servlet23.html
| |
| Tom Vercauteren via JavaKB.com 2005-04-28, 8:58 am |
| Thank you, thank you, thank you.
And also thank you for the link. I think i gonne find a lot of information
on that site!!!
--
Message posted via http://www.javakb.com
|
|
|
|
|