• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem in exception handling

 
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:--
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic