无法将@formbean字段类型启动为list< integer>或整数[]
导入javax.ws.rs.formparam; 导入com.alibaba.fastjson.json;
大家好,JAX-RS似乎无法在Resteasy 2.x/3.x/4.x自动启动列表字段,
我在Servce中使用的VO
public class OrderVO {
@FormParam("id")
private long id;
@FormParam("title")
private String title;
@FormParam("product")
private List<Integer> product;
...
public String toString() {
return JSON.toJSONString(this);
}
}
是
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED+";charset=UTF-8")
@Path("/create")
public InsertResult saveOrder(@BeanParam OrderVO order) {
logger.debug(order.toString());
}
这 或整数[],任何人都可以告诉我为什么...
import javax.ws.rs.FormParam;
import com.alibaba.fastjson.JSON;
Hi guys, The JAX-RS seems cannot init the list field in resteasy 2.x/3.x/4.x automatically,
Here is my VO used in servce
public class OrderVO {
@FormParam("id")
private long id;
@FormParam("title")
private String title;
@FormParam("product")
private List<Integer> product;
...
public String toString() {
return JSON.toJSONString(this);
}
}
And here is my service method:
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED+";charset=UTF-8")
@Path("/create")
public InsertResult saveOrder(@BeanParam OrderVO order) {
logger.debug(order.toString());
}
Other parameters are auto inited except the List or Integer[], and can anyone tell me why....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论