participate


Debugging Tools and Techniques - Debug JSP pages?
<<   Back to Forum  |   Give us Feedback
This topic has 6 replies on 1 page.
MartinHilpert
Posts:3,418
Registered: 10/24/97
Debug JSP pages?   
Mar 30, 2004 4:31 AM

 
I set up Eclipse and Sun Application Server (8) to be able to debug my web application (WAR with servlet and JSP pages) in Eclipse. I can set breakpoints in my java classes and debug them. but i can't set breakpoints in the JSP files. so have can i debug the JSP files? is it possible at all?
 
MartinHilpert
Posts:3,418
Registered: 10/24/97
Re: Debug JSP pages?   
Mar 30, 2004 5:50 AM (reply 1 of 6)  (In reply to original post )

 
I found a solution! see http://forum.java.sun.com/thread.jsp?forum=45&thread=508491&tstart=0&trange=30
 
akash_jauhar
Posts:5
Registered: 10/15/03
Re: Debug JSP pages?   
Apr 9, 2004 9:14 AM (reply 2 of 6)  (In reply to #1 )

 
The above URL gives me an error. can you paste the correct URL again

thanks
Akash
 
MartinHilpert
Posts:3,418
Registered: 10/24/97
Re: Debug JSP pages?   
Apr 13, 2004 1:47 AM (reply 3 of 6)  (In reply to #2 )

 
well, the page seems to be deleted. here's a short description how it works:

A. set up Eclipse to be able to remote debug the web application on the Sun application server. (Just to be sure to have all set up correctly).
B. debugging the JSP pages is not possible directly, but you can debug the translated code from the JSP pages:

I. The translated Java source files are stored in

<SunAppServerInstallDir>/domains/domain1/generated/jsp/j2ee-modules/<context-name>/org/apache/jsp/

add this directory to your Eclipse project, e.g.:

1. Project > Properties
2. Add Folder
3. Create New Folder
4. Folder Name: JSP
5. Advanced >>
6. Link to folder in the file system (select the path above)
7. OK

the project's "Java Build Path" should now contain an entry "<ProjectName>/JSP".

II. In the package explorer you will see the new folder "JSP" with the generated source files. (You may have to start the Web app and klick the pages at least once for the Servlet container to generate the source files.)

Each JSP page results in a Java source file with the name of the JSP page, e.g. "hello.jsp" => "hello_jsp.java". You can ignore Eclipse error indicators (red crosses) for referenced apache classes not found - you don't need them to debug your code.

Well, that's it! just double click such a generated xxx_jsp.java file to open it in a Java Editor and set your breakpionts. Of course, this is not a true JSP-Debugging like Microsoft's ASP debugger, but it's at least better than nothing and still a way step through your JSP functions and have better control over JSP debugging.
 
MartinHilpert
Posts:3,418
Registered: 10/24/97
Re: Debug JSP pages?   
Apr 13, 2004 1:48 AM (reply 4 of 6)  (In reply to #2 )

 
try this: http://forum.java.sun.com/thread.jsp?forum=45&thread=508491
 
yrhduahcmarruhk
Posts:558
Registered: 1/16/02
Re: Debug JSP pages?   
Apr 23, 2004 12:29 PM (reply 5 of 6)  (In reply to #4 )

 
I am using WSAD as the IDE which is pretty similar to I guess the same as eclipse. As far as debugging jsp's with that is you could use the step by step mode to go into the jsp's also I guess you could put breakpoints to the java scriptlets in JSP's. As far as debugging javascript and jsp tags themselves within a jsp I don't understand why would you ant to do that?
 
NM-156
Posts:13
Registered: 1/10/07
Re: Debug JSP pages?   
Feb 22, 2007 5:56 AM (reply 6 of 6)  (In reply to original post )

 
This page has clear and concise steps for debugging JSPs in eclipse (without having to use plugins). Just follow the "Debugging JSP Pages" section. Please note that if you are using the JSTL tag libraries, you would also want to add jstl.jar and standard.jar to your classpath.

http://www.jacoozi.com/index.php?option=com_content&task=view&id=119&Itemid=134

Hope this helps.
 
This topic has 6 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 29
  • Guests : 132

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums