facebook

Debugging JSP with import statements

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #198710 Reply

    I am having problems debugging JSP files with imports. I have an example that re-creates the weird behaviour. Here are the two files I am using:

    index.jsp:
    <%@ include file=”header.jsp” %>
    <%
    System.out.println(“stop here”);
    System.out.println(“and here again”);
    %>
    This is my JSP page. <br>
    </body>
    </html>

    header.jsp:
    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
    <html>
    <head>
    <title>My JSP ‘header.jsp’ starting page</title>
    </head>
    <body>

    When I put a breakpoint on the second line of each JSP file, it seems that MyEclipse only sees as if there were break points in the file that is called, ‘index.jsp’, it stops at the second line of what seems to be the included file, but only shows the calling file. Also if I remove the breakpoint from the included file, header.jsp, the debugger keeps trying to stop at the line where the breakpoint was, triggering the first problem I described.
    My environment is: Windows XP Pro, JDK 1.4.2,Tomcat 5.0.9 Beta, Eclipse 2.1.1 and MyEclipse 2.6.2

    Thx

    #198720 Reply

    Scott Anderson
    Participant

    At present, breakpoints set within included JSP files won’t be honored. This is because the JSP include model simply “inlines” included files so that when loaded by the container, only one file (the class generated for index.jsp in this case) is loaded. However, to debug included JSP files you can simply place a breakpoint on a valid line above the include statement and then ‘Step Over’ the include. Since the included JSP is inlined, the next line will be within the included JSP and it should then be opened and displayed by the debugger.

    –Scott
    MyEclipse Support

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Debugging JSP with import statements

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