Solved

how to change the http error message more understandable

Posted on 2009-04-12
2
228 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

861 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