• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Debugging in jsp

 
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to debug error page in jsp
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if any error occurs in a jsp.at that time you can display proper error jsp page by using the page directive isErrorPage attribute.
 
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look http://java.sun.com/developer/Books/javaserverpages/ProJSP/Chap19.pdf
 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It depends on how you are developing your code. If you are using a modern IDE, they have support.

Years ago, Netbeans had it and Eclipse did not, which drove me to use NetBeans. But I'm considering going to Eclipse as NetBeans is not getting a lot of support, and I expect that Oracle won't help that, if Oracle actually can buy Sun before Sun goes away.
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Misha Ver wrote:Take a look http://java.sun.com/developer/Books/javaserverpages/ProJSP/Chap19.pdf


looks good
 
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rajendra Prakash wrote:How to debug error page in jsp



Put all your JSP code in a try/catch block.

write this before any jsp code: <% try { %>
then you write this in the end of your code <% } catch(Exception e) { e.printStackTrace(); } %>
 
Sheriff
Posts: 67748
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Leandro Coutinho wrote:Put all your JSP code in a try/catch block.


Or join the 21st century and stop putting code in JSP pages.
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Scriptless JSPs are the way to go. If you want to look at the stack trace you can always propogate the exception to the container and let the container log the trace. As for handling the error, you can set up error pages in web.xml.

Eclipse supports JSP debugging and I use it every now and then. Exploded deployments are also your friend
 
reply
    Bookmark Topic Watch Topic
  • New Topic