As the topic says I cannot import this package in my web dynamic project using SpringSource Tool Suite.The command Spring Tools --> Add Spring Project Nature has been already executed. Thank you.
2 Answers
What kind of project did you create? Is it a Maven project? If so, you need to make sure that you are importing 'at least' the spring-context dependency like so
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.1.0.RELEASE</version>
<scope>runtime</scope>
</dependency>
(or whatever version you want to use)
[EDIT]
Since as you say, you are using a Dynamic Web Project through this example -> http://www.vaannila.com/spring/spring-mvc-tutorial-1.html, you need to physically add the following jar files to your WEB-INF/lib
folder
antlr-runtime-3.0
commons-logging-1.0.4
org.springframework.asm-3.0.0.M3
org.springframework.beans-3.0.0.M3
org.springframework.context-3.0.0.M3
org.springframework.context.support-3.0.0.M3
org.springframework.core-3.0.0.M3
org.springframework.expression-3.0.0.M3
org.springframework.web-3.0.0.M3
org.springframework.web.servlet-3.0.0.M3
You should have the following:
Adding the 'Spring Project Nature' does not add the dependencies for you, but only instructs the IDE that this project is using Spring.

- 4,016
- 1
- 32
- 42
-
It is a Dynamic Web Project.Where should I add the xml above?I see a difference with an example I downloaded from sts dashboard.My project's Web App Libraries is empty.I have downloaded all the jars of the framework but I can't add them in my Web App Libraries. – skiabox Feb 05 '12 at 21:27
-
This is the tutorial page I am trying to follow : http://www.vaannila.com/spring/spring-mvc-tutorial-1.html – skiabox Feb 05 '12 at 22:28
-
Ok, so you are not using Maven and you simply need to add the libs to your project :) Let me edit my answer accordingly. – Stefan Z Camilleri Feb 05 '12 at 22:33
Use maven.it automatically adds the necessary jar files.otherwise u need to manually do it.you can have a look at this http://www.mkyong.com/maven/how-to-convert-java-web-project-to-maven-project/ to migrate an existing project into maven
OR
You can manually add the necessary jar files.
Right click on the spring project>>
properties>>
java build path>>
libraries>>Add jars
:)

- 41
- 1
- 6