• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

getting error code in pagenotfound.jsp

 
Ranch Hand
Posts: 223
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 223
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic