'Cannot init the @FormBean field type as List<Integer> or Integer[]
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....
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
