Environment
Eclipse jee version -------- Jdk1.6 version --------- tomcat7.0-X64
Install and configure jdk, eclipse, and tomcat resources. Open eclipse and create a Dynamic web project. The project name is springMVC.
Here tomcat uses your own 7.0. (6.0 is also OK), and then 7.0 corresponds to Dynamic web module version3.0/6.0 and 2.5 corresponds. All of these are irrelevant. By default, you can. Do not Finish, Next->
The compiling output directory is different from the myeclipse directory when you create a web project in eclipse. The build \ classes directory is used when you create a web project in eclipse. myclipse is WEB-INF \ classes while the server's class loader is loaded by default/Under the WEB-INF/classes directory. the class file must be slightly changed here. Change to WebContent/WEB-INF/classes
Then the source folder above can be customized with src. Here I add a resource and test to add folder to store some xml configuration files and use them for testing.
NExt>
The web. xml file can be automatically generated by clicking the check box. By default, the web. xml file is not checked. Check it here, or copy it from other places for use. Do not change other settings by default. Then you can Finish them. After creation
There is no jsp page. You can create a helloworld index. jsp under webcontent. Right-click the springMVC project and choose run as-run on server.
Browser Input
Http: // localhost: 8080/springMVC/displays the hello world on the newly created index. jsp page.