Solved

how to change the http error message more understandable

Posted on 2009-04-12
2
230 Views
Last Modified: 2012-05-06
I want to change the http error message send to client of tomcat to understandable error message. E.g:
HTTP Status 403 - Forbidden

type Status report

message Forbidden

description Access to the specified resource (Forbidden) has been forbidden.
Apache Tomcat/6.0.14

Change to. You cannot access this resource
Is there any ideas? Thanks for any help.
0
Comment
Question by:meoconx
2 Comments
 
LVL 27

Accepted Solution

by:
rrz earned 300 total points
ID: 24126070
On your JSP put
<%@ page errorPage="/403.html" %>
In  your web app's web.xml file add  
    <error-page>
                <error-code>403</error-code>
                <location>/403.html</location>
    </error-page>

The file 403.html can contain
<htm>
           You cannot access this resource
</html>

see
http://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/index.jsp?topic=/com.ibm.commerce.developer.doc/concepts/csdjsperror.htm
http://www.experts-exchange.com/Programming/Languages/Java/J2EE/JSP/Q_23383788.html?sfQueryTermInfo=1+10+error+page
0
 
LVL 5

Expert Comment

by:avya2k
ID: 24129601
There is one method which gets you the errorCode from response
You can use property fiel to match errorCode to your custom message
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question