catch url not found in Tomcat

M

mail2bill

Hi all,

Is there a way to catch the Page Not Found exception in Tomcat when
user did not typed in the correct page name?

I am trying to catch it and then redirect the user to my home page.
Thank you.
 
?

=?ISO-8859-1?Q?Asbj=F8rn?= L. Johansen

Hi all,

Is there a way to catch the Page Not Found exception in Tomcat when
user did not typed in the correct page name?

Put this in your web.xml:

<error-page>
<error-code>404</error-code>
<location>/WEB-INF/404.jsp</location>
I am trying to catch it and then redirect the user to my home page.

Replace /WEB-INF/404.jsp with whatever location you want to redirect to.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top