Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debug JSP from eclipse

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.

like image 644
Dónal Avatar asked Sep 23 '08 19:09

Dónal


People also ask

Can we debug JSP in Chrome?

You can find your JavaScript code in there (since the JS that you put in your JSP should have ultimately been rendered to the page) and you should be able to place breakpoints in it and do anything else you could with a plain . js file.

What is error handling and debugging in JSP?

Debugging in JSP is the process to trace the error in the application. It is not very easy to trace bugs and error in the application. JSP applications are client interactive. Hence, errors are difficult to reproduce.

How do I get JSP in Eclipse?

You right click on the jsp file and then highlight "Open With" . You will get options like JSP Editor, Text editor, Web Page Editor.


2 Answers

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.

like image 159
Dónal Avatar answered Sep 25 '22 01:09

Dónal


Within Eclipse, you can put breakpoints to your jsp file, step through the Java code/tags, etc.
However the only view you can use while debugging is the Variables view to inspect the value of any variable.

And one more thing, you can not see the value for example of this expression:
<%= response.encodeURL("ProcessLogin.jsp") %>
just the value of the variable response.

like image 37
Esteban Avatar answered Sep 21 '22 01:09

Esteban