This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes How to hanfle error code 404 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to hanfle error code 404" Watch "How to hanfle error code 404" New topic
Author

How to hanfle error code 404

sudhakar Tadepalli
Ranch Hand

Joined: Dec 27, 2001
Posts: 130
Hi,
I am using Struts with tiles. I tried utting the following code in web.cml and tryied to access a pege which is not in the web path. I thout it will redirect to the error.jsp page. But browser still shoing file not found 404 page.

<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>


Can any one handle this before with Sruts and Tiles?

Thanks
Sudhakar
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
your path is somehow incorrect for '/error.jsp'. i'd handle it from the web.xml first. you can use struts and tiles and define an /error.do mapped to an (optional) action that forwards to a tiles def. the web.xml then can map the error code to the struts action. since 404 is at the application/server level, this cannot be done using struts alone.


-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
 
 
subject: How to hanfle error code 404
 
Similar Threads
how to trap 404 error
Tomcat settings in an production environment?
Jsp error page handling
error page under WEB-INF
response.sendError & error-page