The moose likes Servlets and the fly likes how to debug a jsp? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to debug a jsp?" Watch "how to debug a jsp?" New topic

how to debug a jsp?

marko markovic

Joined: Mar 16, 2001
Posts: 28
I want know how i can debug a jsp? do i need a tool for it or can i do it with apache-tomcat?

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
Tomcat does not contain any special debugging tools, but you can execute Tomcat from a commercial debugger. JSP are a pain to debug for sure. My advice:
1. Use JavaBeans or other classes that can be tested independently of the JSP as much as possible.
2. Always define an error page and have it dump a stack trace.
3. For complex page layout, start with a plain HTML page that works and add JSP gradually.
4. Always view-source to see what your JSP really wrote.

author of:
Poornima Shetty

Joined: Dec 12, 2000
Posts: 26
The most easiest and efficient way i have found of debugging jsp's is to use System.out.println(); which helps you in clearly knowing what part of your code is been parsed and where its not entering and the moment any of ur s.o.p statements that you have given doesnt get printed on the console then there lies the problem...........
I agree. Here's the link:
subject: how to debug a jsp?
It's not a secret anymore!