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

Can't a page throw more that one exception?

 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My doubt runs around:
Can't a page tell a container more that one errorPage using?
I tried that like:
<%@page errorPage ="ErrorPage1"%>
<%@page errorPage ="ErrorPage2"%>

But I got compiler error saying I can't have more that one page directive
for errorPage attribute with different values.

I wanted like, forward to the page corresponding to error type, decided later on.

One related doubt: I tried to achieve the same by declaring <error-page>
in the Deployment Descriptor, but until I do tell the container using
<%@page errorPage ="errorPage.jsp"%>, it doesn't work. Is that correct?

Can't container find out that from the DD, which error page to forward
in case exception occurs.

Thanks in advance for clarifying my doubts.

Thanks,
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container could find it out if you configure your DD so.

Your could do in the DD

<error-page>
<exception-type> </exception-type>
<location></location>

</error-page>

Where the exception-type is the type of error you want to catch and the location is the location of your error page.

I hope this helps,
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you are right. You have to tell the jsp which is the error page that will do the processing when you encounter any errors in that jsp page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic