Solved

how to change the http error message more understandable

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JAVA part two 5 58
eclipse shortcuts 9 45
object oriented programming comparison 5 56
reverse digits of a number using for loop 5 36
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
The viewer will learn how to implement Singleton Design Pattern in Java.

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now