aspose file tools*
The moose likes Struts and the fly likes replacing scriplet in struts2 jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "replacing scriplet in struts2 jsp page" Watch "replacing scriplet in struts2 jsp page" New topic
Author

replacing scriplet in struts2 jsp page

ganta gopal
Greenhorn

Joined: Feb 05, 2009
Posts: 15
Hi,

I have scriptlet in a jsp which is actually using try/catch (exception handling ) .so i want to convert this jsp page into struts2 jsp page .so how to handle the exception handling scriptlet scenario

Thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What are you doing in your JSP that can throw an exception?

Normally all complex operations are carried out in Java code.
Roberto Hernandez
Ranch Hand

Joined: Apr 29, 2009
Posts: 33
I agree with David that all complex operations should be handled in Java classes. Also, don't use scriptlets in JSP, use JSTL tags for cleaner code. If you really need to catch an exception in a JSP, you can use JSTL c:catch tag.
For example:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: replacing scriplet in struts2 jsp page