Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Spring/RESTEasy的服务器端规则进行动态客户端验证_Spring_Spring Mvc_Resteasy - Fatal编程技术网

使用Spring/RESTEasy的服务器端规则进行动态客户端验证

使用Spring/RESTEasy的服务器端规则进行动态客户端验证,spring,spring-mvc,resteasy,Spring,Spring Mvc,Resteasy,我有一个RESTful web应用程序,其中所有服务器端验证都已就绪。例如,有一个用于创建saleOrder的请求对象: public class WsSaleOrder { @NotNull @Length(max = 45) private String code; @Length(max = 45) private String displayOrderCode; @NotNull @Length(max = 45) pr

我有一个RESTful web应用程序,其中所有服务器端验证都已就绪。例如,有一个用于创建saleOrder的请求对象:

public class WsSaleOrder {
    @NotNull
    @Length(max = 45)
    private String code;

    @Length(max = 45)
    private String displayOrderCode;

    @NotNull
    @Length(max = 45)
    private String customerCode;

    @Length(max = 100)
    private String customerName;
    private String channel;

    @Email
    @Length(max = 100)
    private String notificationEmail;
    ....
}
调用createSaleOrder api时,将验证请求对象并返回验证错误。现在,我想为此创建一个UI表单,并且我希望从可用性的角度来看,所有的验证都出现在客户端


是否有一种标准方法可以通过读取请求对象上的注释来动态地将此验证配置文件传递给客户端。

的可能重复。没有标准方法。下面是我将beanval属性导出到JSON的示例。