Can anyone tell me where to get the response information for an error condition.
I have a JSP that handles all my errors and I would like to get the "404 - File not found" text (or whatever other text there might be for other conditions).
If anyone has some sample code I would appreciate it.

Alexander Zynevich

That is easy indeed, this is from servlet specification 2.2:

Error Handling
A web application may specify that when errors occur, other resources in the application are used.
These resources are specified in the deployment descriptor (See section 13 titled “Deployment
Descriptor” on page 63). If the location of the error handler is a servlet or a JSP, the following
request attributes can be set:
• javax.servlet.error.status_code
• javax.servlet.error.exception_type
• javax.servlet.error.message
These attributes allow the servlet to generate specialized content depending on the status code,
exception type and message of the error.
this means that so - called "errorPage.jsp" could analize this attributes. IMHO
However I dealed with WebSphere which has a lot of pecularities.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact