wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes Debugging Web Project in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Debugging Web Project in Eclipse" Watch "Debugging Web Project in Eclipse" New topic
Author

Debugging Web Project in Eclipse

Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi Everyone,

I am using eclipse in developing web application, but I am having a hard time debugging my web project. Most of the time I use a lot of System.out.println to see my program flow.

Could someone help me find a link about configuring web project(Struts) debugging in eclipse so I can try to Step In, Step Out over my action classes call and put my project in Debug Mode.

I have found a link on using NetBeans and have tried its Debugging Mode. But I am using eclipse and I wanted to know If I can configure its debugging option. Thanks for the Help..


Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 282
There are lots of debug configuration options in Eclipse. What specifically are you attempting to debug? JSPs? Use the Debug Perspective. There are also a number of Views available for this Perspective. The most commonly used are Variables and Breakpoints and each have their own options. Look also at Windows >> Preferences >> Run/Debug. Also, try searching for "debug" in Help >> Help Contents.
[ September 19, 2007: Message edited by: Jay Damon ]
Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi Jay,

I do would like to debug both my JSP and my action classes. But I dont know much how to configure the debug perspective in eclipse.

I have tried netbeans and was able to set breakpoint that allows me to step into/over each of my JSP and Servlet class.

Just would like to find a resource on how to do the same in Eclipse

Thanks in advance
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Which servlet container are you using? Tomcat, or something else?

Eclipse supports a number of different servlet containers, including Tomcat. If you go to Window / Preferences, and then to Server / Installed Runtimes, you can tell Eclipse where your servlet container is. If your project is a Java web project, you can then deploy your application to the servlet container from Eclipse, and start the server in debugging mode from Eclipse. You can put breakpoints in the code of your JSPs, servlets or other classes in your webapp and debug it while it's running in the servlet container.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 282
What specifically do you want to configure in the Debug perspective? When you launch a Debug Perspective, it is essentially ready to go. As Jesper says, all you need to do is start your server in debug mode. The application will stop at any breakpoints you have set and, in the Debug VIEW of the Debug perspective, you will have options to Step Into, Step Over, Step Return, etc.

Your best bet for a debugging resource is to search for "debug" in Help >> Help Contents of Eclipse.
Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi,

I tried looking for the Server Perspective in Window->Preferences->Server, but no entry for Server can be found. Also I tried Window->Show View->Other->Server but cant find it also.

I am using MyEclipse 3.2, am I missing some plugin here or forgot to make some coonfiguration? Also I used tomcat as my web server. I am quite a newbie in using Eclipse IDE.

Thanks for the help..
Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 282
"Servers" is a View not a Perspective. From a Debug (or any other) perspective, select Window >> Show View >> Others >> Server >> Servers. Once a Servers view is open, right-click on the view body and select New >> Server. Follow the prompts to create a server for the appropriate version of Apache Tomcat.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Debugging Web Project in Eclipse
 
Similar Threads
configuring dynamic web project
Debugging in java j2ee
Debuging Eclipse Java Project as External Web Application - debug view not in sync with code
Debugging Tomcat application using Eclipse
plugin for eclipse 3.3.1