Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to hanfle error code 404

 
sudhakar Tadepalli
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic