[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

how to change the http error message more understandable

Posted on 2009-04-12
2
Medium Priority
?
238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
rrz earned 1200 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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

649 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