Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to show one error Page for all kind of HttpStatus error codes (like 404,500)

 
Raju Patel Patel
Greenhorn
Posts: 2
1
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi JavaRanch
Actually I want to show one error page for all kind of HttpStatus error codes. I used

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

tag in web.xml but It can handle only one HttpStatus code 404 error and for handling other HttpStatus error code We have to write again same <error-page> tag with different HttpStatus error code .
Is there any other solution to handle all HttpStatus error codes with single tag to show error page ?
 
K. Tsang
Bartender
Posts: 3524
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since <error-code> is optional, have you try leaving it out and test different status codes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic