差点被com.sun.jersey自身的json转换吓死,遇到List等类型,会把这些也转换为json对象,而不是jsonarray。

被园里的同行拯救了,在web.xml中配置一下就ok。

<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
<param-value>true</param-value>
</init-param>

差点就把jersey的底包换了,换成org.glassfish.jersey的。唉,真折腾。

sun.jersey使用Jackson转换数据的更多相关文章

  1. 使用jackson转换xml格式数据进行响应

    最近在做微信扫码支付的功能,按照微信开发文档与支付平台进行数据交互只能使用XML格式的数据,调用别人定义的接口就需要按规则来嘛,没办法.自己之前使用jackson,主要是因为SpringMVC默认将j ...

  2. eclipse + maven + com.sun.jersey 创建 restful api

    maven 创建 jersey 项目 如果没找到 jersey archetype, 下载 maven 的 archetype xml, 然后导入 archetypes 运行 右击 main.java ...

  3. SQL pivot 基本用法 行列转换 数据透视

    SQL通过pivot进行行列转换 数据透视 可直接在sql server 运行 传统操作 和 pivot create table XKCl (name nchar(10) not null, 学科 ...

  4. json转换数据后面参数要带ture,代码

    强大的PHP已经提供了内置函数:json_encode() 和 json_decode().很容易理解,json_encode()就是将PHP数组转换成Json.相反,json_decode()就是将 ...

  5. 九月 26, 2017 10:18:14 上午 com.sun.jersey.server.impl.application.RootResourceUriRules <init> 严重: The ResourceConfig instance does not contain any root resource classes.

    Tomcat启动错误:九月 26, 2017 10:18:14 上午 com.sun.jersey.server.impl.application.RootResourceUriRules <i ...

  6. Oracle中使用游标转换数据表中指定字段内容格式(拼音转数字)

    应用场景:将数据表TB_USER中字段NNDP的内容中为[sannanyinv]转换为[3男1女] 主要脚本:一个游标脚本+分割字符串函数+拼音转数字脚本 操作步骤如下: 1.创建类型 create ...

  7. springCloud 服务注册启动报错<com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect>

    报错:com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: ...

  8. springCloud com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect

    1.com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: c ...

  9. java.lang.ClassCastException: class com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text

    Text的包导错了 不是:import com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider.Text; 而是:import ...

随机推荐

  1. Android 最火开发框架 xUtils

    xUtils简介 xUtils3 api变化较多, 已转至 https://github.com/wyouflf/xUtils3 xUtils 2.x对Android 6.0兼容不是很好, 请尽快升级 ...

  2. C#aspx页面前台使用<%=%>无法取到后台的值

    检查是不是有拼接问题,正常public和protected修饰的字段或属性均可使用<%=%>.另外,加载(Page_Load)时有没有给它们赋初始值? 答 1)前台页面只能调用本后置代码的 ...

  3. 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Weixin' did not find a matching property.

    警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclips ...

  4. mysql增加远程连接用户及查看数据库表结构

    一.增加远程连接用户 1.用root权限登录数据库  2.加用户:grant all privileges on *.* to '111'@'192.168.1.%' identified by '2 ...

  5. 7.Reverse Integer (INT; Overflow)

    Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 思路:要注意溢出 ...

  6. 300最长上升子序列 · Longest Increasing Subsequence

    [抄题]: 往上走台阶 最长上升子序列问题是在一个无序的给定序列中找到一个尽可能长的由低到高排列的子序列,这种子序列不一定是连续的或者唯一的. 样例 给出 [5,4,1,2,3],LIS 是 [1,2 ...

  7. popupMenu-----弹出菜单

    import android.os.Bundle; import android.app.Activity; import android.graphics.Color; import android ...

  8. jquery 处理重新绑定插件的方法

    比如有一个slide的jquery插件,页面打开就对dom进行了绑定. <div class="expert"> <div class="expert- ...

  9. apache日志里出现GET http://wujieliulan.com/mnews.htmHTTP/1.1解决方法

    笔者最近搭建了服务器,Ubuntu 16.04.3 LTS,apache日志里老是出现一些莫名其妙的日志. 好像谁用了我的服务器做代理,日志如下 凭借着小学文化 :) 勉强读懂了汉语拼音wujieli ...

  10. Vue.js 登录注册实现

    转载 http://www.jb51.net/article/118003.htm