File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes JSP Debugging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "JSP Debugging" Watch "JSP Debugging" New topic
Author

JSP Debugging

Thiru Thangavelu
Ranch Hand

Joined: Aug 29, 2001
Posts: 219
Does anybody know how to debug in Eclipse or IDEA intellij? Appreciate your help.


Thanks,<br />Thiru<br />[SCJP,SCWCD,SCBCD]
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
What sort of debugging are you loking for? What sort of bugs do you have in the code at the moment?
Eclipse has good support for JUnit, which catches most of the bugs I put in to my code


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Thiru Thangavelu
Ranch Hand

Joined: Aug 29, 2001
Posts: 219
Thanks Frank,
I have both eclipse and IDEA configured in my machine. I could able to debug Java Code(both java beans, and J2EE and core classes). Is there a way there that I can debug JSP pages? I can able to debug a JSP page if it has useBean tag. But how to debug JSP page which has no useBean tags but with lots of java code.. Where do i get more info on this? Did anyone did this before??? Sorry for asking many questions.. But just want to know is there a way to do...
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
I must be misunderstanding you. I still don't understand what sort of bug(s) you are trying to fix, and what problems you are having which prevents you. Can you give any more specific examples?
If it seems easier to fix code in a bean, then why not move the code which seems to be failing into a bean?
FARuessel
Greenhorn

Joined: May 07, 2003
Posts: 4
Hi,
try following Plugins:
* Lomboz (J2EE Project, JSP Highlighting, ..)
* Sysdeo (works better for JSP Debugging)
When talking about "JSP Debugging" its about debugging the servlet code (which is generated at runtime). Should be no prob, eh?
I feel comfortable with Sysdeo which adds "Tomcat Project" to the "New Project" menu. Using this the project structure is fine for Tomcat 4.x ...
felix
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
I'm finding this discussion strangely hard to understand. It's like I recognize all the words, but other people seem to be reading different things from them.
Can you explain how a Tomcat project differs from a regular Java project? Can you explain how this helps you to fix bugs?
The original poster seemed to be asking how to use an IDE to fix bugs in JSPs, which itself seems strange to me. I've always thought of an IDE as a essentially tool for writing software. I largely understand (and make a lot of use of) the automated refactoring support in Eclipse, for example, but the idea of a tool which will somehow automatically fix bugs seems astonishing!
All clarifications welcomed.
FARuessel
Greenhorn

Joined: May 07, 2003
Posts: 4
Hi,
a Tomcat Project is essentially a Java Project with specific settings. Instead of creating a "Java Project" and configurating these settings manually (and adding specific folders manually) you can chose to create a "Tomcat Project" (Sysdeo) where important settings have reasonable default values (for development JSP with Tomcat as JSP container) and required folders are generated automatically.
Refactoring is (normally) not about automatically fixing bugs (even if in somecases removing bugs can be done automatically).

When you start writing JSPs you may create buggy JSPs. Doing so you want to debug these JSPs ... you need a way to step through the JSP or the generated Servlet. Thats JSP / Servlet debugging.
Mohan Panigrahi
Ranch Hand

Joined: Sep 28, 2001
Posts: 142
Hi Thiru,
Is there a way there that I can debug JSP pages

Try Pramati Studio. It is an excellent IDE for J2EE debugging, and for JSPs you debug them [ put breakpoints, see variable values etc. ] as JSPs and not the generated servlets.
Regards
Mohan
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
you need a way to step through the JSP or the generated Servlet. Thats JSP / Servlet debugging.
Ah. So you reckon the original poster was actually asking for a way to step through generated JSP code. Not something I've ever felt I needed to do.
What sort of faults do you think might need this approach? I know I've found JavaScript a tough challenge to test in the past, but if I have ever thought I had a problem with the Java code in a JSP, I've just moved the code out to a bean, a tag, or just a regular Java class, and tested/fixed it there.
Or do you think the problem is actually in the code generated by the JSP engine for rendering the HTML or the actual code which calls the user-suppied tags and beans? That sounds more like a container fault, and I'd be tempted to try the application in a different container!
FARuessel
Greenhorn

Joined: May 07, 2003
Posts: 4
Its a good strategy to move as much functionality
as possible from the JSP to a bean. Still there
may be circumstances where you want to debug your
JSPs .. maybe you didnt write that JSP but you
want to monitor what exactly is happening when the
JSP is processes and the generated servlet is
executed. What about all the variables in the
context that might be set (or not??) and used
.... I do not recommend to put too much logic
into JSP exactly for the reason of debugging and
because it leads to tight coupling.
Thiru Thangavelu
Ranch Hand

Joined: Aug 29, 2001
Posts: 219
Thanks everyone for your help.
Frank,
I know, we don't need much JSP debugging. But in my case, when I am fixing the bugs I need to navigate through other's pages in which I don't know what they coded. I can't even put their code in a separate bean and call from the Jsp page since it is already gone to production and I can not change each and every JSP. So I just needed a way to see what values they are getting when I am navigating through their pages. Hope you can understood.
Thanks Mohan, I am actually getting PRAMATI Studio now and let u know abt that.
Thanks Everyone.
 
jQuery in Action, 2nd edition
 
subject: JSP Debugging