This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes How to handle jsp runtime exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to handle jsp runtime exceptions " Watch "How to handle jsp runtime exceptions " New topic
Author

How to handle jsp runtime exceptions

Ramesh Yakkala
Greenhorn

Joined: May 12, 2005
Posts: 5
Hi,

May I know how to handle the jsp runtime exceptions.

I knew one jsp as error page my including the isErrorPage='true' page attribute and provide the jsp as errorPage in other jsp's.

But my requirement,I am using the tiles frame work,which is logically forming the header,footer,body.

So if I give error jsp,it shows only error jsp with out header and footer,since I am not calling the tiles.

Is there a way to configure the jsp run time errors through the web.xml url patter?

or Is there a way to call the url pattern in jsp,when jsp run time exception throughs?

Thanks,
Ramesh Yakkala.
harshvardhan ojha
Ranch Hand

Joined: Jul 26, 2007
Posts: 157
    
    1

you can do something like

in your web.xml.
Ramesh Yakkala
Greenhorn

Joined: May 12, 2005
Posts: 5
harshvardhan ojha wrote:you can do something like

in your web.xml.


I am using the follwoing code in web.xml

<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/error</location>
</error-page>

wouldn't handle it?

Thanks for the reply.
harshvardhan ojha
Ranch Hand

Joined: Jul 26, 2007
Posts: 157
    
    1

why throwable and not exception. ideally you would like to handle all exception conditions but not errors. isn't it?
 
Don't get me started about those stupid light bulbs.
 
subject: How to handle jsp runtime exceptions
 
Similar Threads
Design choice for dispatching request to view
How to handle exceptions occured in tiles in struts 1.2
Null error in "Menu" Tile
Tiles insert throwing a Null exception
Struts passing data across tiles