Debugging JSP Pages

When executed as part of a web application, a JSP page is actually translated into a servlet, called the generated servlet, which is then compiled and run. You can set breakpoints in JSP pages in either the JSP source file or in the generated servlet.

To debug a JSP page:

  1. Set a breakpoint.
  2. Open the JSP file in the source editor. Move the cursor to a line and in the IDE, choose Debug -> Toggle Breakpoint.

    The line in the source editor changes its background color indicating that breakpoint has been set.

  3. Compile the JSP file.
  4. Right-click inside the source editor and choose Compile.

  5. In the web browser, entry data and submit the page.
  6. Execution of the JSP page stops at the breakpoint, and the line in the source editor is highlighted indicating that execution stopped at that line.

  7. Use the Call Stack View to monitor and change variable values.
  8. In the Call Stack view, expand the _jasper._JSP file name._jspService node.

    Under the node, you can see the variables for the JSP file. Change variable values as desired and in the IDE, choose Debug -> Continue. The debugger now continues execution of the JSP file with the new variable values.

  9. When finished debugging, move the cursor to the line with the breakpoint and choose Debug -> Toggle Breakpoint.
  10. The breakpoint is removed from the line, and its background color resets to the normal editing color.

See also
Debugging the Application
Preparing the Web Module for Debugging
Starting and Stopping the Debugger
Debugging EJBs

Legal Notices