[Resolved]How to set the breakpoint for a JSP file [message #1836163] |
Tue, 22 December 2020 21:45 |
Jim Anderson Messages: 109 Registered: October 2014 |
Senior Member |
|
|
I am running Eclipse WTP 2020-09. It took a week or more to get Eclipse running, but I have been running it for over a week now and have been making good progress in debugging my java code. While debugging the java code, I have been ignoring obvious problems in the display of the webpage.
It is interesting that the results of the JSP code appear correctly when I run the webpage using Tomcat 9.0 outside of Eclipse. When I run the same code inside Eclipse, I am getting errors. I'm guessing this is a configuration problem in Eclipse.
Today, I started to try to debug the JSP code inside of Eclipse. In the project explorer, I double clicked on the JSP file that I want to debug and the source code is displayed in a widow tab next to other (java) source code windows.
In the java windows, I can double-click the line number and a break point gets set for that line.
In the JSP window, in a javascript scripting section of the code, I double-click the line number and a "Add Bookmark" window pops-up. I add a name and click "OK" and a bookmark gets set, with a small blue rectangle next the line number. I'm not sure what the bookmark is used for, but I can look that up later. What I really want is that the double-click creates a breakpoint in the JSP code, just as it does for java.
If I right-click on a JSP source line, the pop-up menu does not display a choice to add a breakpoint.
Can someone help?
[Updated on: Wed, 23 December 2020 15:25] Report message to a moderator
|
|
|
Re: How to set the breakpoint for a JSP file [message #1836166 is a reply to message #1836163] |
Wed, 23 December 2020 01:56 |
|
A bookmark is the kind of marker that you'll see in the Bookmarks view. It doesn't interrupt program execution or anything, it's just a way for you to mark a location in your files so that you can easily get back there later. Unlike Tasks, you always have to create them manually.
You can only set Java breakpoints in lines that would become executing Java source code, everything else like JavaScript is just template code output to the browser as-is, without any debug information added to the final class file (usually). The source file's line has to have a scriptlet, expression, declaration, or a JSP standard or custom action, as those will become Java statements/expressions and be compiled by the server. The toggle option appears over the vertical ruler, the same place where the bookmarks/breakpoints show up on the left. We just never decided to show it in the context menu since the other marker types aren't usually shown their either.
Sharing what unresolved error messages you see is a first step in resolving them.
_
Nitin Dahyabhai
Eclipse Web Tools Platform
[Updated on: Wed, 23 December 2020 01:58] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01935 seconds