This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem In Import Spring 3 Library

 
Rahul Bhalla
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Today I start Learning Spring3 and tried to build a hello spring program for that [b] I start using STS(Spring tool Suite) as IDE and library which i paste under lib folder under web content is [/b]
org.springframework.web-sources-3.1.2.RELEASE,
org.springframework.web.servlet-sources-3.1.2.RELEASE
org.springframework.expression-sources-3.1.2.RELEASE
org.springframework.core-sources-3.1.2.RELEASE
org.springframework.context.support-sources-3.1.2.RELEASE
org.springframework.beans-sources-3.1.2.RELEASE
org.springframework.asm-sources-3.1.2.RELEASE
jstl-1.2
commons-logging-1.1.1

.[b]but i found give error[/b]
"The import org.springframework.stereotype.Controller cannot be resolved"
"The import org.springframework.web.servlet.ModelAndView cannot be resolved"
"The import org.springframework.web.bind.annotation.RequestMapping cannot be resolved".


please Suggest me what is wrong ???
Thanks for your Consideration
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rahul Bhalla wrote:which i paste under lib folder under web content is


Don't do that. You will want to use Maven (or Gradle) to build your applications and handle your dependency management. Spring brings in like 50 libraries not even counting transitive dependencies. It is not a light dependency graph, it is essential for this reason that you use a something like Maven or you will be working way to hard to get things running. Also you were copying the sources into the lib folder you need the classes, the sources are only used if you want to build Spring itself which I am sure is not your intention.

My suggestion if you are using STS is to start with the template project. Go to File -> new Spring Template Project -> Spring MVC Project.

This will create a sample spring project. You can build it by right clicking the project and saying run as -> Maven Install
 
Rahul Bhalla
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
copying the sources into the lib folder you need the classes
Thanks for solving my problem
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic