Debugging a JSP

Java source code in a JSP can be debugged in the usual manner as regular Java code.

Note: The Web project must be targeted to a WebLogic server runtime.

To debug a JSP:

  1. Switch to the J2EE perspective.
  2. In the Project Explorer view, expand the Web project.
  3. Within the project, you will find a WebLogic folder labeled wls81 (for WebLogic Server 8.1), wls70 (for WebLogic Server 7.0) or wls61 (for WebLogic Server 6.1).
  4. Expand the folder and then double-click on weblogic.xml. This opens the WebLogic-specific Web deployment descriptor in the XML editor.
  5. Ensure weblogic.xml specifies a working directory like this:
    <jsp-param>
        <param-name>workingDir</param-name>
        <param-value>C:/workspace/MyWebProject/WebContent/WEB-INF</param-value>
    </jsp-param>
    where workingDir is a valid path for generated servlet code.
  6. Also ensure the JSP parameter keepgenerated is set to true in weblogic.xml.
  7. Add breakpoints in the JSP. Breakpoints can only be set on lines containing Java source.
  8. Publish the application to a WebLogic server.
  9. In the Project Explorer view, right-click on the JSP and select Debug > Debug on Server.

This will start the WebLogic server and open a browser to the JSP. Debug execution will pause at the first breakpoint.

Related tasks
Publishing your application

Terms of use | Feedback
(C) Copyright IBM Corporation 2002, 2004. All Rights Reserved.