File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes debugging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "debugging" Watch "debugging" New topic


Madhusudan Raju

Joined: Dec 27, 2006
Posts: 4
how do you debug in jsp
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Madhusudan Raju,
Please take the time to choose the correct forum for your question.
This forum is for Servlet questions.

Moving to JSP

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
My number one suggestion for debugging in JSP or servlets is to put all the working code in "helper" classes that can be tested and debugged OUTSIDE the servlet/jsp environment.

There are so many things that can go wrong when you plunk totally untested code into a jsp/servlet container that it is hard to conduct intelligent debugging. Just browsing through recent posts will convince you of that.

Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Is there a particulare IDE you are using?

With WebSphere Studio Application Developer, or IBM's Rational Application Developer (IRAD), you can set breakpoints in Java code in a JSP and step through your code at runtime. It's an invaluable service.

Having said that of course, there is great value in minimizing the amount of code in a JSP. Factore out logic into custom tags or Java classes which are easier to maintain, reuse, and debug.

-Cameron McKenzie
Neerav Narielwala
Ranch Hand

Joined: Dec 08, 2006
Posts: 106

has your answer. :-)

<a href="" target="_blank" rel="nofollow">Java Tutorials</a> | <a href="" target="_blank" rel="nofollow">Java Weblog</a> | <a href="" target="_blank" rel="nofollow">Computing Articles</a>
I agree. Here's the link:
subject: debugging
It's not a secret anymore!