vote up 1 vote down
star

Hi,

Does anyone know of a good tool for debugging JSPs from within Eclipse? I'd like to be able to set and watch breakpoints, step through the Java code/tags, etc within Eclipse while the app is running (under JBoss in my case).

Presumably it's reasonably straightforward to debug the servlet class that's generated from a JSP, but it's also fairly unappealing :)

Cheers, Don

offensive?
comments (1)

3 Answers:

vote up 2 vote down

BEA Workshop for JSP should work well. You might want to try the full workshop that Oracle released after they bought BEA.

link|offensive?
add comment
vote up 1 vote down

If you have WTP installed, you can set breakpoints within a JSP and they work fine in a regular "remote debug" session. However, once you've stopped on a breakpoint, stepping through the code is nigh on impossible and finding whatever it is that you wish to inspect takes a lot of digging around in the "Variables" view.

link|offensive?
add comment
vote up 1 vote down

If you are having to use a debugger in a JSP, chances are very good that you are doing things in the JSP that you shouldn't be. I recommend that you think very hard about whether your current implementation is using good MVC design practice. JSPs really should be about presentation, which shoudl rarely (if ever) require debugging.

If you have certain logic constructs that you are having to implement in JSP, consider implementing them using a custom tag (which is easy to debug in an IDE), or do the processing in controller servlet that presents the data in an easy to digest form for the JSP.

link|offensive?
add comment

Your Answer:


hide preview
Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.