-1
我试图禁用一个类的方法的验证。Struts2禁用验证
我已经看过注释@SkipValidation
,但它不起作用。我试图把下面的interceptor-ref放到我的动作中,但它也不起作用。
<interceptor-ref name="validation">
<param name="excludeMethods">ricerca,execute</param>
</interceptor-ref>
我需要删除此类的Date
字段的验证。
定义“不起作用”。另外,如果您在操作配置中指定了拦截器配置,则必须指定* all *拦截器。你可以参考你使用的任何堆栈,并且参数名称也使用'validation.excludeMethods',IIRC。 –
与不工作我的意思是它不表现我想要的。为什么不用我用'@ SkipValidation'注释的方法跳过验证? – Emaborsa
它应该通过以下拦截器http://struts.apache.org/release/2.3.x/struts2-core/apidocs/org/apache/struts2/interceptor/validation/AnnotationValidationInterceptor.html。 –