我有一个自定义注释@MyAnnotation
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD })
public @interface MyAnnotation {
  String [] roles() default {};
}我使用我的注解作为
@MyAnnotation
@RequestMapping(value = "/test/xyz", method = RequestMethod.POST)
@ResponseBody
public String myFunc(@Valid TestClass test) {
    return "Name: " + test.getName();
}我希望在来自Javax的@Valid注释之前执行我的自定义注释@MyAnnotation,因为我在注释实现中执行一些安全检查,这些检查需要在验证正文之前执行。
有没有办法提高自定义注解的优先级,使其在@Valid注解之前执行?
发布于 2017-04-22 16:20:05
https://stackoverflow.com/questions/43556544
复制相似问题