View Javadoc
1   package uk.ac.ebi.intenz.webapp.dtos;
2   
3   import org.apache.struts.action.ActionErrors;
4   import org.apache.struts.action.ActionMapping;
5   import org.apache.struts.validator.ValidatorForm;
6   
7   import javax.servlet.http.HttpServletRequest;
8   
9   /**
10   * This ActionForm only manages the <code>ec</code> parameter.
11   * <p/>
12   * The Validator framework checks if the EC number is valid.
13   *
14   * @author Michael Darsow
15   * @version $Revision: 1.2 $ $Date: 2008/01/28 12:33:07 $
16   */
17  public class EcSearchForm extends ValidatorForm {
18    private String ec;
19  
20    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
21      ActionErrors errors = super.validate(mapping, request); // Use EcValidator.
22      if (errors == null) errors = new ActionErrors();
23      if (errors.isEmpty()) return null;
24      return errors;
25    }
26  
27    public String getEc() {
28      return ec;
29    }
30  
31    public void setEc(String ec) {
32      this.ec = ec;
33    }
34  
35  }