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:
- Switch to the J2EE perspective.
- In the Project Explorer view, expand the Web project.
- 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).
- Expand the folder and then double-click on weblogic.xml. This opens the WebLogic-specific Web deployment descriptor in the XML editor.
- 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.
- Also ensure the JSP parameter keepgenerated is set to true in weblogic.xml.
- Add breakpoints in the JSP. Breakpoints can only be set on lines containing Java source.
- Publish the application to a WebLogic server.
- 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