This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error mtd in jsp

 
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: 9593
34
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: 65537
108
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: 65537
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is "mtd" a real word?
 
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!