This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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: 60752
    
  65

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: How to configure single error page with different messages for different error codes like 400, etc?
 
Similar Threads
customizing messages
Sample Error jsp page?
page not showing, need tips on debugging
Messages displayed only if I use saveErrors()
Custom message for ERROR 405