title: Validation with Struts 2 Convention plugin on method level, not class level
body: <p>I have the a class, CouponAction, with two methods, initCoupon and addCoupon. I only want validation on the addCoupon method, not on class level where it tries to validate all methods.</p>
  
  <p>this class with methods looks something like this</p>
  
  <pre><code>@Scope("prototype") @Controller
  
  @Namespace("/coupon")
  
  public class CouponAction extends BaseAjaxAction&lt;Coupon&gt; {
  
  ............
  
  @Action(value = "initPaymentCoupons", results = {
  
  @Result(location = "/jsp/order/coupon/paymentCoupon.jsp", name = "success")
  
      })
  
  public String initCoupons(){
  
  ........
  
  }
  
  
  @Validations(requiredFields = {
  
  @RequiredFieldValidator(fieldName = "couponCode", type = ValidatorType.FIELD, message = "Enter a coupon code")
   })
  
  @Action(value = "/addCoupon", interceptorRefs=@InterceptorRef("jsonValidationWorkflowStack"),
              results = {
  
  @Result(location = "/jsp/order/coupon/paymentCoupon.jsp", name = "success")
  
  })
  
  public String addCoupon() {
  
  .......
  
  }
  </code></pre>
  
  <p>Then I get:</p>
  
  <pre><code>2011-11-10 00:44:13,567 ERROR org.apache.struts2.components.ActionComponent.error:38 - Could not execute action: /coupon/initCoupons
  No result defined for action vervik.actions.order.CouponAction and result input
  </code></pre>
  
  <p>All examples Iv seen uses the validation annotation on class level.
  When I used xml I had a file:
  CouponAction-addCoupon-validation.xml 
  which only validation the addCoupon method.</p>
  
  <p>How can I make it work with validation annotation?</p>
  
  <p>Sources:</p>
  
  <p><a href="http://struts.apache.org/2.1.6/docs/convention-plugin.html#ConventionPlugin-InterceptorRefannotation" rel="nofollow noreferrer">http://struts.apache.org/2.1.6/docs/convention-plugin.html#ConventionPlugin-InterceptorRefannotation</a></p>
  
  <p><a href="http://struts.apache.org/2.0.14/docs/annotations.html" rel="nofollow noreferrer">http://struts.apache.org/2.0.14/docs/annotations.html</a></p>