SpringMVC 添加 RestController 支持
阿新 • • 發佈:2018-05-16
dispatch AS patch 添加 not ont sage stc code 2. 修改
1. 下載依賴包
http://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
http://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
http://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations
2. 修改 dispatcher-servlet.xml
<mvc:annotation-driven/>
<mvc:default-servlet-handler/>
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter"/>
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
</mvc:message-converters>
</mvc:annotation-driven>
SpringMVC 添加 RestController 支持