|Setting break points in an html file [message #1404507]
||Sat, 02 August 2014 15:13
| Jim Anderson
Registered: October 2014
I am still in startup mode with WTP, but I am making progress. I have been able to
run 'helloworld' in Luna Eclipse, using WTP. With a bit of configuration I was
able to run Eclipse using Tomcat 7 configured into Eclipse and the results of running show up in a 'browser' view running under Eclipse. So far, so good.
However, if I look at the source code in the tab labelled, 'index.html', in the attachment, I cannot set a breakpoint. When I am looking at C++ or java code
in Eclipse, I can normally click on the line number to the left of the source code line where I want to set a break point and Eclipse will set the point for me.
When I click on the line number of the html code, an 'Add bookmark' popup window
Am I wrong to expect a break point to be set when I click on the line number?
|Re: Setting break points in an html file [message #1405061 is a reply to message #1404801]
||Wed, 06 August 2014 13:26
| Larry Isaacs
Registered: July 2009
On 8/5/2014 4:49 PM, Jim Anderson wrote:|
> I did a duckduckgo search and came up with the following from the
> Eclipse database.
> It looks like setting break points does not work for JSP files unless the
> code is enclosed in a scriptlet, i.e. <% ... %>. Actually, I tried adding
> some java code to a JSP page to see if I could set a break point. I
> could not.
I did a quick test with Luna and setting a break point in scriptlet code
in a JSP continues to work for me. This implies you are doing or
expecting something different, but there isn't enough information here
to say what.
I believe WTP uses some "generic" handling to track the Java code in the
JSP to provide some JDT support for that code, including setting break
points. Because this handling is "generic", it doesn't know exactly
what the various versions of Tomcat are going to do with the HTML
portion of the JSP. Thus, Eclipse doesn't know what Java code the line
in the HTML will correspond to. However, while debugging, you are
working off of the actual compiled JSP, so once you have hit the break
point, you can single step through the Java code that follows. Jasper,
the JSP compiler in Tomcat, writes debug information to the JSP's
compiled class file so that stepping through the code matches the line
numbers in the JSP file, instead of the Java file that was generated for
Powered by FUDForum
. Page generated in 0.08895 seconds