1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.struts.validator;
19
20 import org.apache.struts.action.ActionMapping;
21
22 import javax.servlet.http.HttpServletRequest;
23
24 import java.io.Serializable;
25
26 /***
27 * <p>This class extends <strong>ValidatorForm</strong> and provides basic
28 * field validation based on an XML file. The key passed into the validator
29 * is the action element's 'path' attribute from the struts-config.xml which
30 * should match the form element's name attribute in the validation.xml.</p>
31 *
32 * <ul>
33 *
34 * <li>See <code>ValidatorPlugin</code> definition in struts-config.xml for
35 * validation rules.</li>
36 *
37 * </ul>
38 *
39 * @version $Rev: 376984 $ $Date: 2005-05-07 12:11:38 -0400 (Sat, 07 May 2005)
40 * $
41 * @since Struts 1.1
42 */
43 public class ValidatorActionForm extends ValidatorForm implements Serializable {
44 /***
45 * Returns the Validation key.
46 *
47 * @param mapping The mapping used to select this instance
48 * @param request The servlet request we are processing
49 * @return validation key - the action element's 'path' attribute in this
50 * case
51 */
52 public String getValidationKey(ActionMapping mapping,
53 HttpServletRequest request) {
54 return mapping.getPath();
55 }
56 }