Paolo
Paolo

Reputation: 2472

Debugging JSP pages in WebLogic

I need to debug some JSP pages, served by WebLogic. So I set up the remote debug in Eclipse, set the appropriate port number.

It seems to work, since entering in debug perspective and stopping the exceution actually works. Unfortunately when setting a breakpoint on a JSP, the BP doesn't work.

I am sure I am setting the BP on the right page, unless some strange transformation is made on the JSP I upload to the server.

I found here that these line in weblogic.xml should do the trick

<?xml version="1.0" encoding="UTF-8"?> 
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90">
    <jsp-descriptor>
        <keepgenerated>true</keepgenerated>
<working-dir>theWD</working-dir>
        <backward-compatible>true</backward-compatible>
        <debug>true</debug>
    </jsp-descriptor>
    <context-root>/</context-root>
</weblogic-web-app>

I actually have these lines in weblogic.xml, in the theWD directory i have all the .java files with name as follow: foreach *.jsp file

name.jsp -->  __name.java

I also added the theWD folder to eclipse source lookup, but still no result.

Upvotes: 3

Views: 5303

Answers (1)

Andrew Latham
Andrew Latham

Reputation: 6152

You can't set a breakpoint directly in JSP; however, you can trick your debugger into letting you do essentially the same thing.

Since it's JSP, you are able to call a method in a Java class. Put a test line that calls that method right before whatever line in the JSP file you want your breakpoint to be on. Find that Java class, set a breakpoint in the method being called, and then trace up through the stack until you get back to your JSP file.

Upvotes: 5

Related Questions