aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes getting error code in pagenotfound.jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "getting error code in pagenotfound.jsp" Watch "getting error code in pagenotfound.jsp" New topic
Author

getting error code in pagenotfound.jsp

hasan khan
Ranch Hand

Joined: Aug 04, 2003
Posts: 222

my web.xml looks like this

<error-page>
<error-code>404</error-code>
<location>/pagenotfound.jsp</location>
</error-page>

<error-page>
<error-code>403</error-code>
<location>/pagenotfound.jsp</location>
</error-page>


i have created a common page for 2 different error code.
i want to show different message for different error code.
in pagenotfound.jsp how can i find that what error code cause this page to be called ?
Nitish Bahadur
Ranch Hand

Joined: Aug 25, 2003
Posts: 118
Read the "javax.servlet.error.status_code" request attribute in your error page. This should be either 403 or 404.

In the real world, the web servers have pre-defined error pages for the HTTP Status codes between 300-400 and 400-500.
hasan khan
Ranch Hand

Joined: Aug 04, 2003
Posts: 222

how do i use those pre-defined error pages for the HTTP Status codes between 300-400 and 400-500.

i am using weblogic 8.1 as well as tomcat 5.0.28
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting error code in pagenotfound.jsp
 
Similar Threads
Handling 404 Error
problem using error-page tag
Please Help - Using JSF
How to configure custom error pages in jboss-5.1.0?
redirect if error 404 comes