标签:spring mvc
Short memo for how to build Spring MVC develepmnet environment (for windows). In case you have any questions, please feel free to leave message to me under this article. I will update and add more details according to your concern.
Firstly, please make sure you have eclispe and tcomcat installed locally and intergrated as expected.
1.Spring framwork download
http://repo.spring.io/release/org/springframework/spring/
2. Apachce Commons Logging Download
https://commons.apache.org/proper/commons-logging/
(Download commons-logging-1.2-bin.zip, you can also find it in attached file)
3.two more jstl jar (Please refer to attached files.)
Now Config and Test.
New Dynamic Web Project on Eclipse (Project Name: spring-mvc-demo)
Copy all the jar files to /WEB-INF/lib
Config xml files under WEB-INF. (Please find them in attached file)
Create Congtroller class. (HomeController.java)
Define Controller method.
Add Request Mapping to Controller method
Return View Name
package com.marvin.springdemo; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class HomeController { @RequestMapping("/") public String showPage() { // return to main-menu page return "main-menu"; } }
Develop View Page (main-menu.jsp)
<!DOCTYPE html> <html> <body> <h2>Spring MVC Demo - Home Page</h2> </body> </html>
File hierachy.
Run on Server
本文出自 “Marvin” 博客,请务必保留此出处http://marvinchen.blog.51cto.com/6457668/1983354
Build Spring MVC development environment
标签:spring mvc
原文地址:http://marvinchen.blog.51cto.com/6457668/1983354