File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring 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: 61420
    
  67

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?