如何用@ResponseBody注解实现实体与json的转换

2025-04-25 14:36:05
推荐回答(1个)
回答1:

spring配置注解同时启用@ResponseBody,@RequestBody 注解实现实体与json转换

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">




class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"
depends-on="lifecycleBeanPostProcessor">



               
 
 




 







         class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" >