Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Return Exceptions  RSS feed

 
hammigi_d
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
How do I pass/catch the exceptions in JSP which occured in bean class?

Thanks in advance,
hammigi
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ideally, all exceptions should be caught before passing context to the JSP.
If you're performing controller functionality from your JSP you will have to catch exceptions there.

If you're still using scriptlets, you can wrap any bean method calls in a try/catch block; just as you would in any Java program:


If you're not using scriptlets, JSTL has try/catch tags to give you the same functionality.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"hammigi_d" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy. User names cannot be obviously fake and must constist of a first name and a last name.

You can change your user name here.

Thanks! and welcome to the JavaRanch!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!