spring-mvc-showcase-master 是官网上关于spring mvc使用的showcase, 包含了各种spring mvc的使用案例; 配置:
- 使用MAVEN进行工程管理
- 官网使用的MAVEN JDK为1.6,我降级为1.5见POM.xml文件
- 使用TOMCAT6来做J2EE应用服务器插件,见POM.xml文件
- Jackson JSON Processor升级使用2.1.5,案例中使用1.8.1
- SPRING MVC配置上的改变 :使用来进行配置MVC相关信息,跟以前不同;内容改变见http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd 和servlet-context.xml
- <mvc:annotation-driven/>中包含了很多默认的设置:如默认使用MappingJackson2HttpMessageConverter来处理application/json的数据;
spring3以前的配置习惯:
<!-- RESTFUL SPRING 3 --> <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" /> <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"> <property name="messageConverters"> <list> <ref bean="jsonConverter" /> </list> </property> </bean> <bean id="jsonConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
本文深入探讨了Spring MVC Showcase中的配置与实践案例,包括使用MAVEN进行工程管理,配置J2EE应用服务器TOMCAT6,升级JacksonJSONProcessor及SPRINGMVC配置的改变等关键点。
9780

被折叠的 条评论
为什么被折叠?



