Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Setting break points in an html file(WTP runs 'helloworld', but I cannot step through any html source code)
Setting break points in an html file [message #1404507] Sat, 02 August 2014 15:13 Go to next message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 51
Registered: October 2014
Member
Hi,

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
comes up.

Am I wrong to expect a break point to be set when I click on the line number?

Jim A.
Re: Setting break points in an html file [message #1404801 is a reply to message #1404507] Tue, 05 August 2014 20:49 Go to previous messageGo to next message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 51
Registered: October 2014
Member
I did a duckduckgo search and came up with the following from the
Eclipse database.

https://www.eclipse.org/forums/index.php/mv/msg/59644/188561/#msg_188561

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.

Jim
Re: Setting break points in an html file [message #1405061 is a reply to message #1404801] Wed, 06 August 2014 13:26 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1325
Registered: July 2009
Senior Member
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.
>
> https://www.eclipse.org/forums/index.php/mv/msg/59644/188561/#msg_188561
>
> 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.
>
> Jim

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
the JSP.

Cheers,
Larry
Previous Topic:Error while openning Dynamic Web Project in Eclipse
Next Topic:Glassgish based project, i need to restart the server every time i do a modify
Goto Forum:
  


Current Time: Sat Apr 18 03:44:44 GMT 2015

Powered by FUDForum. Page generated in 0.01890 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software