tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles N. Harvey III" <charl...@alloy.com>
Subject Re: getting the error type/code
Date Mon, 09 Aug 2004 00:32:13 GMT
Thanks Tim.  This was exactly it.

request.getAttribute( "javax.servlet.error.status_code" );


Charlie


Tim Funk said the following on 8/7/2004 7:54 PM:

> Its in 'Table SRV.9-1 Request Attributes and their types' of the 
> servlet spec:
>
> Request Attributes Type
> javax.servlet.error.status_code java.lang.Integer
> javax.servlet.error.exception_type java.lang.Class
> javax.servlet.error.message java.lang.String
> javax.servlet.error.exception java.lang.Throwable
> javax.servlet.error.request_uri java.lang.String
> javax.servlet.error.servlet_name java.lang.String
>
> So look in the ServletRequest() an attribute called 
> "javax.servlet.error.status_code" of type Integer.
>
> -Tim
>
> Charles N. Harvey III wrote:
>
>> Hello.
>> If I create one error page and point all of the error codes
>> (400, 401, 403, 404, 408, 500) to the same page, how do I figure
>> out which error code was sent so I can display a different message
>> to the user?
>> Can this be done or do I have to create a separate page for each
>> error code?  Is the error in the HttpServletRequest somewhere?
>>  
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message