File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts 2 Validation Annotation issue.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 Validation Annotation issue.." Watch "Struts 2 Validation Annotation issue.." New topic

Struts 2 Validation Annotation issue..

Santhosh Kg

Joined: Aug 17, 2009
Posts: 8

I am new to struts 2 and is having problem with validation annotation.
The scenario is,i have 2 methods in my action class and i wanted to have validation for only one method.
I use @Validations for the method i need validation and @SkipValidation for the other method.

My interceptor-stack is like the below,

<interceptor-stack name="myStack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="breadCrumbs"/>
<interceptor-ref name="validation">
<param name="validateAnnotatedMethodOnly">true</param>
<param name="excludeMethods">input,back,cancel,browse</param>

The problem is,if i use @SkipValidation,there will not be any validation at all(for both the methods) and if i remove @SkipValidation,
there is validation for both the methods.. :-(

Can anybody help please..
I agree. Here's the link:
subject: Struts 2 Validation Annotation issue..
jQuery in Action, 3rd edition