Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error-page doubt

 
bernard savary
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Can we specify a servlet to handle error in error-page ...

<error-page>
<exception-type>java.lang.Exception</error-page>
<location>(can we have a servlet name or URL mapping here)</location>
</error-page>
 
Tomaszz Lewandowski
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlet spec says:
The location element contains the location of the resource in the web application relative to the root of the web application. The value of the location must have a leading '/'.

Yes, you can specify location that maps to servlet.
 
bernard savary
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tomaszz . just one more question , ca we have 2 error-page element one specifying an error-code and one with exception-type ? .
I mean not under same error-page element in but 2 different error-page elemens in web.xml.
 
Tomaszz Lewandowski
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic