Spring can be used in both Java SE and Web applications, and this is just about applications in Web programs.
The following is an example of the Spring 3.0.5 release.
Using spring in the Web requires only the following two steps:
First, copy all the jar packages under the dist path of the spring project to the Web-inf/lib path of the Web application;
Second, copy the required third-party class library files under Spring's Spring-framework-3.0.5.release-dependencies.zip decompression path to the Web-inf/lib path of the Web App.
Create a new project in IntelliJ idea
Select Web Application
After the project is built,
Create a new folder under Web-inf Lib
Then, as described above:
First, copy all the jar packages under the dist path of the spring project to the Web-inf/lib path of the Web application;
Second, copy the required third-party class library files under Spring's Spring-framework-3.0.5.release-dependencies.zip decompression path to the Web-inf/lib path of the Web App.
The key is this third-party class library did not find Ah, only see the Dist folder below, first copy it past it.
Then build path
Sure enough to be here or wrong, I still can't escape to download Spring's dependency package, but it seems that spring 3.0.5 will not provide a dependency package.
I guess I'll have to do it myself.
Exception in thread "main" java.lang.noclassdeffounderror:org/apache/commons/logging/logfactory
And then I found this jar on the Internet, Com.springsource.org.apache.commons.logging-1.1.1.jar, let's try it first.
The approximate project structure is this, and then bean.xml I see the source of the book is put here, so for the time not understand clearly.
Finally, a small example of the control reversal in the book is realized, which is a beginning.
Using the spring framework in Web applications and IntelliJ idea