jQuery in Action, 2nd edition
The moose likes JSP and the fly likes JSP Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "JSP Exception" Watch "JSP Exception" New topic
Author

JSP Exception

Bandita Acharya
Greenhorn

Joined: Mar 23, 2010
Posts: 20
How to handle Exception in JSP?please give one example..
Thanks in advance
Devaka Cooray
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2691
    
    3

"bandita java", please check your private messages regarding an important administrative matter.


Author of ExamLab (Download) - the free mock exam kit for SCJP / OCPJP
Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3359

It is a super best practice not to include Java snippets in your JSP markup.
All coding stuff should be done in Servlets (or in your framework Action classes or whatever it called), JSP should only be used for producing the markup.
Devaka Cooray
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2691
    
    3

You can catch the runtime exceptions by using the <c:catch> tag of JSTL
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56153
    
  13

You shouldn't. Define a centralized error handler in the deployment descriptor.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Aman Goel
Greenhorn

Joined: Jan 14, 2010
Posts: 15
I will suggest you to use centralize error page in JSP.
By doing so ,if any error will come, it will redirected to error page. Here you can handle the errors.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Exception
 
Similar Threads
JSP - Out of Memory exception
implicit object in Tag file
can we do exception handleing in JSP
jsp access exception
Exceptions in JSP