解决cxf中list中对象为1个时返回json串问题的配置文件
来源:互联网 发布:人工智能假肢技术 编辑:程序博客网 时间:2024/06/06 02:20
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:jaxrs="http://cxf.apache.org/jaxrs"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/utilhttp://www.springframework.org/schema/util/spring-util.xsdhttp://cxf.apache.org/jaxrshttp://cxf.apache.org/schemas/jaxrs.xsdhttp://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd"><import resource="classpath:META-INF/cxf/cxf.xml" /><import resource="classpath:META-INF/cxf/cxf-servlet.xml" /><import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" /><util:list id="jsonKeys"><value>app</value><value>comment</value></util:list><util:list id="jsonTypes"><value>application/json</value><value>application/jettison</value></util:list><bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"><property name="arrayKeys" ref="jsonKeys" /><property name="serializeAsArray" value="true" /><property name="produceMediaTypes" ref="jsonTypes" /><property name="consumeMediaTypes" ref="jsonTypes" /></bean><jaxrs:server id="commonsService" address="/"><jaxrs:extensionMappings><entry key="json" value="application/json" /><entry key="xml" value="application/xml" /></jaxrs:extensionMappings><jaxrs:serviceBeans><ref bean="commentsServiceImpl" /><ref bean="userServiceImpl" /><ref bean="postServiceImpl" /><ref bean="contentRestImpl" /><ref bean="collectListRestImpl" /><ref bean="downloadListRestImpl" /><ref bean="rankServiceRestImpl" /><ref bean="appAddImpl" /><ref bean="appPush" /></jaxrs:serviceBeans><jaxrs:providers><ref bean="jsonProvider" /></jaxrs:providers></jaxrs:server></beans>
详情请参照网友hdxiong的博客:http://hdxiong.iteye.com/blog/1752036
从他那里找到的答案,谢谢~~~
- 解决cxf中list中对象为1个时返回json串问题的配置文件
- java中返回的JSON对象转换成List 用法
- [struts2] Struts2中采用Json返回List对象数据为空解决方案
- Struts2中采用Json返回List对象数据为空解决方案
- Struts2中采用Json返回List对象数据为空解决方案
- 解决Gson解析Json时,Json-中Key为Java关键字的问题
- 解决Gson解析Json时,Json 中Key为Java关键字的问题
- java中List对象转换为JSON对象
- java中List对象转换为JSON对象
- java中List对象转换为JSON对象
- java中List对象转换为JSON对象
- 解决OneThink中模型中字段参数为函数时无返回值的问题
- 解决list转换json出现的各类问题 object转换为Map对象
- ######springmvc中方法返回值为String时@responseBody不能返回json对象。
- 解决springMVC中restful的POST请求时接受json对象转换pojo对象失败问题
- cxf web service 解决返回的json格式数据乱码问题
- 解决javaweb返回json中文为问号的问题
- VC++6.0中,返回值为一个结构体时,对象复制2次的问题
- iOS:系统结构(1)
- 最小生成树算法
- javascript中的while循环
- 出错提示:“Could not flush the DNS Resolver Cache: 执行期间,函数出了问题”的解决方法
- 给iphone应用Default.png添加效果
- 解决cxf中list中对象为1个时返回json串问题的配置文件
- 关于request.getParameter(java.lang.String name)
- HTTP状态码说明
- Linux下NFS(网络文件系统)的建立与配置方法
- Android中获取应用程序(包)的信息-----PackageManager的使用
- Sql server 2005带来的分页便利
- javascript中的for循环
- vg的扩展和删除
- C++ string转char*