How to build a simple project for SPRINGMVC through Eclipse is now a brief introduction.
Tools/Materials
- Eclipse
- Related JAR Packages
Method/Step
To create a new Dynamic Web project, select the project, click Next to fill in the item name, and click Next to select Generate Web. XML to end.
Create the relevant folder under the project, including java,resources (storing spring and other resource files), view (store dynamic page), right click on Project, modify properties---sources For Java and resources (new resource folder)
Introduce the relevant jar package, as below, including commons-logging-1.1.1.jar;spring-beans-
4.0.5. Release.jar;spring-context-4.0.5.release.jar;spring-context-support-4.0.5.release.jar;spring-core-4.0.5.release.jar;sprin G-expression-4.0.5.release.jar;spring-web-4.0.5.release.jar;spring-webmvc-4.0.5.release.jar;spring-webmvc-portlet-4.0.5.r Elease.jar, etc.
Modify the Web. xml file to add related content such as spring.
Create a new Spring directory folder under the Resources directory, where you create a new springmvc.xml,applicationcontext-web.xml configuration file and edit the relevant content.
Build index.jsp in the view directory and edit the contents of the page to save. To modify Web. XML, build a welcome page:
<welcome-file-list>
<welcome-file>view/index.jsp</welcome-file>
</welcome-file-list>
Save.
Create a new class file for the spring controller file; Edit the return page byebye.jsp
Start with Tomcat, in the browser input: http://localhost:9090/springMVC/, click the link, call controller return to Byebye page, the project was established successfully.
Eclipse builds SPRINGMVC Simple project