tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven J. Owens" <puffm...@darksleep.com>
Subject Re: Debugging JSPs
Date Wed, 29 Jan 2003 10:46:05 GMT
On Wed, Jan 29, 2003 at 11:24:30AM +0100, Ron van Pol wrote:
> I've asked some question before regarding remote debugging of JSPs
> with tomcat4. Since nobody has responded yet, I'll give it another
> try. Can anybody please tell me how they debug JSPs with tomcat4?

     With great care and painstaking slowness :-).

     Seriously, I've played with the JPDA remote-debugging stuff for
debugging complex servlets, but I didn't find it all that useful
(though I didn't try that hard, and I was only using a
half-implemented early version of JSwat, and arguably I was using it
for the wrong sort of problem).  However, I don't know how in the heck
you'd use that to remote-debug JSPs.

     From my limited experience with JSPs, most of the bugs occur in
either the JSP compiling stage, or in the process of running the
resulting servlet.  I would love ot see some flavor of JSP compiler
that provided more helpful error messages, maybe even a sort of JSP
"lint" tool.  Lest I seem ungrateful to the Tomcat crew, I should note
that I found Jasper, the JSP compiler that tomcat bundles, much more
helpful than the ones bundled with Weblogic and JRun.  However, either
way, I don't think that's amenable to remote debugging, other than by
just pushing the .JSP files up to the server and trying to load the
page.

     Now, the alternative is that you're talking about bugs in the
reuslting servlet code.  If you're seeing significant amounts and
complexity of bugs in the resulting servlet, you probably have too
much java in your JSP.  Move the java out to helper classes -
javabeans, or taglibs, or even (in a pinch) just special servlets or
singleton classes you can grab from your JSP.  Now you can remote
debug the helper classes the same way you would remote debug any java
class.

     In case you haven't tried that, yet, that essentially boils down
to starting the JVM with a special command-line option that sets up
the remote debugger and has it listen on a port for your debugger's
requests for information.  See more about how to do that with tomcat
here:

http://www.bluemarsh.com/java/jswat/docs/howto-servlet.html

     There *must* be something on this topic at the jakarta website,
right?  I couldn't find it with a little surfing,... ah, *here* it is:

http://jakarta.apache.org/site/idedev-rdtomcat.html

     Oh, hey, somebody on the JSwat user mailing list says they've
figured out how to remote-debug JSPs with tomcaT:

http://www.bluemarsh.com/pipermail/jswat-user/2002-September/001317.html

     It's amazing what you can do with a little web surfing :-) Don't
feel too bad, though; I've googled fruitlessly for hours, in the past,
and finally broke down and posted a request, only to have somebody
come back with, "Gee, I just plugged <keyword-I-never-thought-to-try>
into google and the answer was on the first hit."  Some days you get
the bear, some days the bear gets you :-).

Steven J. Owens
puff@darksleep.com

"I'm going to make broad, sweeping generalizations and strong,
 declarative statements, because otherwise I'll be here all night and
 this document will be four times longer and much less fun to read.
 Take it all with a grain of salt." - Me at http://darksleep.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message