aspose file tools*
The moose likes Servlets and the fly likes is there any Compulsory to give the try /catch in jsp page. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "is there any Compulsory to give the try /catch in jsp page." Watch "is there any Compulsory to give the try /catch in jsp page." New topic
Author

is there any Compulsory to give the try /catch in jsp page.

Ramasubramaniam Rathinasubbu
Ranch Hand

Joined: Jun 09, 2010
Posts: 44
is there any Compulsory to give the try /catch in jsp page.
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

What are you trying to accomplish and what are the situations, where you except an exception to be thrown.

As a rule of thumb, avoid any java code or scriptlets in jsp and instead use custom tags.

using try/catch in jsp is a bad design. Instead put all your java logic in a bean or custom tags and handle the exception in those classes instead of jsp.

But, what are the situations you expect an exception be thrown in jsp.


Regards
KumarRaja

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60992
    
  65

No. In fact, since you should have no Java code in a JSP page, there's no need for try/catch.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is there any Compulsory to give the try /catch in jsp page.