GeeCON Prague 2014*
The moose likes Servlets and the fly likes problem in exception handling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "problem in exception handling" Watch "problem in exception handling" New topic
Author

problem in exception handling

jawwad ahmed
Ranch Hand

Joined: Dec 01, 2001
Posts: 179
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

Joined: Mar 22, 2000
Posts: 12791
    
    5
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

Joined: Oct 17, 2001
Posts: 4313

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


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
Biju Nair
Ranch Hand

Joined: Dec 15, 2001
Posts: 31
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:--


--: Biju Nair :--
 
GeeCON Prague 2014
 
subject: problem in exception handling