KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > struts > validator > DynaValidatorActionForm


1 /*
2  * $Id: DynaValidatorActionForm.java 54929 2004-10-16 16:38:42Z germuska $
3  *
4  * Copyright 2000-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 package org.apache.struts.validator;
20
21 import java.io.Serializable JavaDoc;
22 import javax.servlet.http.HttpServletRequest JavaDoc;
23
24 import org.apache.commons.beanutils.DynaBean;
25 import org.apache.struts.action.ActionMapping;
26
27 /**
28  * <p>This class extends <strong>DynaValidatorForm</strong> and provides
29  * basic field validation based on an XML file. The key passed into the
30  * validator is the action element's 'path' attribute from the
31  * struts-config.xml which should match the form element's name attribute
32  * in the validation.xml.</p>
33  *
34  * <ul><li>See <code>ValidatorPlugin</code> definition in struts-config.xml
35  * for validation rules.</li></ul>
36  *
37  * @version $Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
38  * @since Struts 1.1
39  */

40 public class DynaValidatorActionForm extends DynaValidatorForm implements DynaBean, Serializable JavaDoc {
41
42     /**
43      * Returns the Validation key.
44      *
45      * @param mapping The mapping used to select this instance
46      * @param request The servlet request we are processing
47      * @return validation key - the action element's 'path' attribute in this case
48      */

49     public String JavaDoc getValidationKey(ActionMapping mapping,
50                                    HttpServletRequest JavaDoc request) {
51
52         return mapping.getPath();
53     }
54
55 }
56
Popular Tags