Meaningless Drivel is fun!*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: replacing scriplet in struts2 jsp page
 
Similar Threads
struts2
Page navigation using struts2
migration to Struts2
struts2 bean tag
Interceptors in Struts2