Spring MVC 02 - Create web application with spring mvc framework in eclipse

1. First of all, you must have eclipse first. I will not go into details about the installation of eclipse here. Turn right when you go out and look for Du Niang. I am using eclipse j2ee Indigo version 1.9.2 here

2. Let's start with the steps to create a spring mvc web application

2.1 Create a project. File>New>Dynamic Web Project Enter the Project name, I define the project name here as FirstSpringMVCPro, Dynamic web module version This option refers to the servlet version to be used by the project, if you create j2ee5, select 2.5 or below version 2.5 , if you created j2ee6, select version 3.0 or below; then click next, continue to click next, in the Web Module panel, remember to check Generate web.xml deployment descriptor, and finally click finish. After creation, the directory structure of the project is as follows:


2.2 Add spring related jar package. The jar package of spring can be downloaded at http://repo.spring.io/release/org/springframework/spring/, decompress the downloaded compressed package, and copy the decompressed file to the WebContent>WEB-INF>lib folder

2.3 Add the common-logging.jar package required by the web application. common-logging.jar can be downloaded at http://commons.apache.org/proper/commons-logging/download_logging.cgi. After downloading, copy the jar file to WebContent>WEB-INF-lib folder

At this point, the spring mvc Web project has been established.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326030805&siteId=291194637