Debugging a Web Application

See Also

You can use the Sun Microsystems JPDA debugger from the IDE to debug web applications, servlets, and JSP files. Just as with Java programs, the IDE enables you to set new watches, evaluate a variable by holding the cursor over the variable, and set breakpoints in JSP files, JSP documents, and JSP segments. A tag file is debugged when you debug the JSP file that references it.

The method that you use to start a debugging session depends on the type of web component that you want to debug.

To debug a web application:
  1. Set breakpoints and watches in the web application's JSP files, servlets, and other source files.
  2. If necessary, specify request parameters in the JSP files and servlets.
  3. Right-click the project node in the Projects window and choose Debug from the pop-up menu.
To debug a JSP file:
  1. Set breakpoints and watches in the JSP file and, optionally, its tag files.
  2. If necessary, specify request parameters in the JSP file.
  3. Right-click the JSP file's node and choose Debug File. Optionally, choose Debug > Debug file.jsp (Ctrl-Shift-F5) from the main menu.

    When you change a JSP file while in a debugging session, you do not need to start a new debugging session. Just reload the page.

To debug a servlet:
  1. Set breakpoints and watches in the servlet.
  2. If necessary, specify request parameters in the servlet.
  3. Right-click the servlet's node and choose Debug File. Optionally, choose Debug > Debug file.java (Ctrl-Shift-F5) from the main menu.
  4. See Also
    Starting a Remote Debugging Session
    Starting a Local Debugging Session
    Creating A Debug Target for a Free-Form Web Project

    Legal Notices