这里有一个应用程序,它使用 @JsonViews 来操作来自 web 服务的实体的 json 输出。
public class Customer implements Serializable {
@Id
@JsonView(ListView.class)
private String customerID;
@NotNull
@Size(min = 3)
@JsonView(DetailView.class)
private String companyName;
网络服务方法:
@POST
// also tested but not working with @JsonView(DetailView.class)
public Customer updateCustomer(Customer customer) {
return customerService.updateCustomer(customer);
}
在 Wildfly 8 和 9 中一切正常,但在 Wildfly 10 上,当我们发布客户时,“客户”对象只有“空”值。当我从客户对象中删除“@JsonViews”时,将正确使用没有任何 jsonview 的属性。
任何想法为什么 Wildfly 10 具有与以前版本相同的行为以及如何修复它?
非常感谢
PS:带有 JSONViews 的 GET 请求按预期工作
@GET
@JsonView(DetailView.class)
public Customer getCustomerById....