Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / April 2005

Tip: Looking for answers? Try searching our database.

Redirecting error page 404...

Thread view: 
Tom Vercauteren - 26 Apr 2005 19:16 GMT
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
Tor Iver Wilhelmsen - 27 Apr 2005 14:02 GMT
> 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 - 28 Apr 2005 07:50 GMT
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!!!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.