Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP Exception  RSS feed

 
Bandita Patel
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to handle Exception in JSP?please give one example..
Thanks in advance
 
Devaka Cooray
Marshal
Posts: 5512
687
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"bandita java", please check your private messages regarding an important administrative matter.
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a super best practice not to include Java snippets in your JSP markup.
All coding stuff should be done in Servlets (or in your framework Action classes or whatever it called), JSP should only be used for producing the markup.
 
Devaka Cooray
Marshal
Posts: 5512
687
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can catch the runtime exceptions by using the <c:catch> tag of JSTL
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You shouldn't. Define a centralized error handler in the deployment descriptor.
 
Aman Goel
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will suggest you to use centralize error page in JSP.
By doing so ,if any error will come, it will redirected to error page. Here you can handle the errors.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!