Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

replacing scriplet in struts2 jsp page

 
ganta gopal
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic