This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse IDE: set a break on Spring DispatcherServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse IDE: set a break on Spring DispatcherServlet" Watch "Eclipse IDE: set a break on Spring DispatcherServlet" New topic
Author

Eclipse IDE: set a break on Spring DispatcherServlet

H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 395
If I have a regular web app or a regular java app, I can set a break on the servlet or util class I have the source code.

Now for Spring MVC (for example), I have the jar file placed in WEB-INF\lib folder,
how I can set a break any where within org.springframework.web.servlet.DispatcherServlet?

Generically speaking, how I can set a break on thirdparty jar like struts etc...? because I want to debug the flow.

What are the basic systematically steps that I should do? Thanks.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Those are open source, which means that the sources are available - download the sources and put them on your PC. And Eclipse let's you attach the sources to the JARs - in your project's properties, under Java Build Path, Libraries tab, expand the desired JAR and you will see a Source Attachment entry, click on that click the Edit button and browse to where the sources are located.

By the way, if you are using Maven you can do this automatically by configuring the Maven setting in Eclipse to download the source and doc files automatically. Then as long as the source and doc jars are available in the Maven repository, they will be used.

Once you do all of that, you should be able to step into the methods used in that JAR.


JBoss In Action
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 395
Thanks for your 1M$ answer. How I can give you 2 thumbs up? 1 for eclipse and 1 for maven. Extremely cool!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Eclipse IDE: set a break on Spring DispatcherServlet
 
Similar Threads
Relative Path problem
Relative Path problem
How to add new jar files to class path dynamically at runtime?
Adding JARS to the classpath - what are the implications?
calling a web service from a session bean