This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JSP and the fly likes How to configure single error page with different messages for different error codes like 400, etc? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to configure single error page with different messages for different error codes like 400, etc?" Watch "How to configure single error page with different messages for different error codes like 400, etc?" New topic
Author

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

jack hiren
Greenhorn

Joined: Sep 12, 2012
Posts: 6
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

Joined: Jan 10, 2002
Posts: 63227
    
  69

Error information is available in request scope to help you make these decisions. See the Servlet Specification for details.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: How to configure single error page with different messages for different error codes like 400, etc?
 
It's not a secret anymore!