• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to configure single error page with different messages for different error codes like 400, etc?

 
jack hiren
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing an web-application.
I am looking to configure error pages in web.xml.
I want to make a single error page with different error messages for different http errors like 400,404,etc.
For example : I want to use the same error page "error.jsp" for all http errors.
assume if error 400 arises, jsp should display "Bad request"
and if error 404 occurs,jsp should display messgae as "page not found".


please help.

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Error information is available in request scope to help you make these decisions. See the Servlet Specification for details.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic