Using the spring framework in Web applications and IntelliJ idea

Source: Internet
Author: User
Tags java se

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.