facebook

JSP Debugging

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #197688 Reply

    David Baker
    Member

    I downloaded MyEclipse a short time ago and have been working with it on a very small project to learn about it. I am using Tomcat 5.0, and I am trying to test JSP debugging. At best I would say it is very shaky. The little flag does not always appear when I insert a breakpoint. If I put a breakpoint in some Java code and proceed to it, the breakpoint in the JSP will then get the little flag.

    If I am finally able to get it to stop at a JSP breakpoint, it will not do “step over”, it just does “step into” for everything.

    If I change the launch preference to run without debug, it still shows the debug view. This may be ok, but then I don’t know what the launch preference means.

    #197691 Reply

    Scott Anderson
    Participant

    I am trying to test JSP debugging. At best I would say it is very shaky.

    I believe the “issues” you bring up are simply a misunderstanding about what you’re seeing. I’ll address them one by one to try to clear things up for you.

    The little flag does not always appear when I insert a breakpoint. If I put a breakpoint in some Java code and proceed to it, the breakpoint in the JSP will then get the little flag.

    The “little flag” is actually a checkmark on the breakpoint and it is placed there by the Eclipse debugger when the class is actually loaded in the remote VM. When you first place the breakpoints, typically the JSP pages have not been compiled and loaded yet since this occurs only when they’re first referenced. This is default Eclipse behavior and we do nothing to augment or modify it.

    If I am finally able to get it to stop at a JSP breakpoint, it will not do “step over”, it just does “step into” for everything.

    If you mean that the debugger steps “into” your JSP includes you are correct. However, it’s not really a step “into”. Please remember that the inclusion model for JSP pages is just that, inclusion. As a result, included pages are inlined in the main JSP page. So, “step over”, which steps to the next line, is doing exactly that. It’s just that the next line’s source is in a different JSP file. Step into will drop into invoked java code, but step over is working correctly with respect to included fragments.

    If I change the launch preference to run without debug, it still shows the debug view. This may be ok, but then I don’t know what the launch preference means.

    The debug / run setting governs whether or not breakpoints will be registered with the VM, nothing more. So, when you select ‘run’ and launch, none of your breakpoints will be hit. It’s basically the same as running in debug mode, but selecting all your breakpoints in the breakpoints view and disabling them. Only there’s no reenablement.

    Hope that clears everything up.

    –Scott
    MyEclipse Support

    #198029 Reply

    jw08816
    Member

    Scott,

    I have two JSP pages to debug. When placing the break point, one page displayed a green/blue dot at the break point another displayed a green/blue dot with a flag at the break point. I can stop and debug at the breakpoint only for the JSP page with a flag. I do not know how to bring the flag up for the other JSP page.

    Please help.

    Thanks,
    Jerry

    #198030 Reply

    Scott Anderson
    Participant

    Jerry,

    The flag on the breakpoint is the Eclipse debugger’s way of telling you that the code for the page has already been loaded into the remote VM. This happens the first time the page is viewed.

    One additional thing to keep in mind is that breakpoints will only be honored in top-level JSP pages. Included JSP fragments are inlined in the top-level pages to to debug them, set a breakpoint above the include in the page which includes the fragment of interest. Then, when you “step over” the include, you’ll be shown the lines executed within the included fragment.

    –Scott
    MyEclipse Support

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: JSP Debugging

You must be logged in to post in the forum log in