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

Error mtd in jsp  RSS feed

 
Dinesh Tahiliani
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,

How can i catch error in jsp?
When i open suppose a jsp page and while opening it caught error , how can i show to user that error is been occured.
Please expalin in detail
 
Ankit Garg
Sheriff
Posts: 9608
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use a try-catch block using scriptlets in your JSP and display the error in the catch block. Or you can use an error page in your web application configuration or in the page directive of your JSP. But I think in the second case if the output is flushed to the client, then the error page will not be displayed.

Here is how you can put a try-catch block to your JSP page

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Except of course, that scriptlets in JSPs should no longer be used.

Also, please use real words when posting to the forums. Abbreviations such as "mtd" in place of whatever it's supposed to mean (I have no clue) only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff
 
Dinesh Tahiliani
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn' get you .

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is "mtd" a real word?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!