KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > webapp > admin > valve > RequestDumperValveForm


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

16
17 package org.apache.webapp.admin.valve;
18
19 import javax.servlet.http.HttpServletRequest JavaDoc;
20 import org.apache.struts.action.ActionError;
21 import org.apache.struts.action.ActionErrors;
22 import org.apache.struts.action.ActionForm;
23 import org.apache.struts.action.ActionMapping;
24 import java.util.List JavaDoc;
25
26 /**
27  * Form bean for the Request Dumper valve page.
28  *
29  * @author Manveen Kaur
30  * @version $Revision: 1.4 $ $Date: 2004/06/28 02:14:51 $
31  */

32
33 public final class RequestDumperValveForm extends ValveForm {
34         
35     // ----------------------------------------------------- Instance Variables
36

37     
38     // ------------------------------------------------------------- Properties
39

40         
41     // --------------------------------------------------------- Public Methods
42

43     /**
44      * Reset all properties to their default values.
45      *
46      * @param mapping The mapping used to select this instance
47      * @param request The servlet request we are processing
48      */

49     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
50     
51         super.reset(mapping, request);
52     }
53     
54     
55     /**
56      * Render this object as a String.
57      */

58     public String JavaDoc toString() {
59
60         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("RequestDumperValveForm[adminAction=");
61         sb.append(getAdminAction());
62         sb.append("',valveType=");
63         sb.append(getValveType());
64         sb.append("',objectName='");
65         sb.append(getObjectName());
66         sb.append("]");
67         return (sb.toString());
68
69     }
70     
71     /**
72      * Validate the properties that have been set from this HTTP request,
73      * and return an <code>ActionErrors</code> object that encapsulates any
74      * validation errors that have been found. If no errors are found, return
75      * <code>null</code> or an <code>ActionErrors</code> object with no
76      * recorded error messages.
77      *
78      * @param mapping The mapping used to select this instance
79      * @param request The servlet request we are processing
80      */

81     
82     public ActionErrors validate(ActionMapping mapping,
83     HttpServletRequest JavaDoc request) {
84         
85         ActionErrors errors = new ActionErrors();
86         
87         String JavaDoc submit = request.getParameter("submit");
88         
89         // front end validation when save is clicked.
90
if (submit != null) {
91          // no validation needed
92
}
93                  
94         return errors;
95     }
96 }
97
Popular Tags