Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in exception handling

 
jawwad ahmed
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have witten the foolowin line in web.xml for handling exception
<error-page>
<exception-type>NullPointerException<exception-ype>
<location>/hello.htm</location>
</error-page>
i have also tried
<error-page>
<exception-type>java.lang.NullPointerException<exception-ype>
<location>/hello.htm</location>
</error-page>
but when i write startup on dos prompt like
c:\tomcat3.2\bin\startup
exception come on the screen.(on prompt screen of web-server)
I don't know why this so.
i have putted htm file in the following folder.
c:\tomcat2\webapps\examples\hello.htm

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you get that exception on startup then it occurs before Tomcat is able to serve web pages.
What are you expecting this <error-page> tag to do?
Bill
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jawwad ahmed:
i have witten the foolowin line in web.xml for handling exception
<error-page>
<exception-type>NullPointerException<exception-ype>
<location>/hello.htm</location>
</error-page>

Could the error you're getting be caused by the fact that your web.xml is invalid due to the spelling of <exception-type> ?


------------------
- Jessica Bradley
HP Bluestone
 
Biju Nair
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also write a separate error page and redirect all JSPs to this page when ever an error occurs. For this add
<%@page errorPage="<your error page>"%>
in your JSPs. This will make the JSP redirect to error page when ever an exception occurs.

------------------
--:Biju:--
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic