KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > jmx > browser > web > form > DetailForm


1 /*
2
3  * EJTools, the Enterprise Java Tools
4
5  *
6
7  * Distributable under LGPL license.
8
9  * See terms of license at www.gnu.org.
10
11  */

12
13 package org.ejtools.jmx.browser.web.form;
14
15
16
17 import javax.servlet.http.HttpServletRequest JavaDoc;
18
19
20
21 import org.apache.struts.action.ActionError;
22
23 import org.apache.struts.action.ActionErrors;
24
25 import org.apache.struts.action.ActionForm;
26
27 import org.apache.struts.action.ActionMapping;
28
29
30
31 /**
32
33  * Description of the Class
34
35  *
36
37  * @author letiemble
38
39  * @created 13 février 2002
40
41  * @version $Revision: 1.6 $
42
43  * @todo Javadoc to complete
44
45  */

46
47 public class DetailForm extends ActionForm
48
49 {
50
51    /** Description of the Field */
52
53    protected String JavaDoc reference = null;
54
55
56
57
58
59    /** Constructor for the ConnectForm object */
60
61    public DetailForm() { }
62
63
64
65
66
67    /**
68
69     * Getter for the factory attribute
70
71     *
72
73     * @return The value of factory attribute
74
75     */

76
77    public String JavaDoc getReference()
78
79    {
80
81       return this.reference;
82
83    }
84
85
86
87
88
89    /**
90
91     * Description of the Method
92
93     *
94
95     * @param mapping Description of the Parameter
96
97     * @param request Description of the Parameter
98
99     */

100
101    public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) { }
102
103
104
105
106
107    /**
108
109     * Setter for the factory attribute
110
111     *
112
113     * @param reference The new reference value
114
115     */

116
117    public void setReference(String JavaDoc reference)
118
119    {
120
121       this.reference = reference;
122
123    }
124
125
126
127
128
129    /**
130
131     * Description of the Method
132
133     *
134
135     * @param mapping Description of the Parameter
136
137     * @param request Description of the Parameter
138
139     * @return Description of the Returned Value
140
141     */

142
143    public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request)
144
145    {
146
147       ActionErrors errors = new ActionErrors();
148
149
150
151       if ((this.reference == null) || (this.reference.length() < 1))
152
153       {
154
155          errors.add("reference", new ActionError("error.factory.required"));
156
157       }
158
159
160
161       return errors;
162
163    }
164
165 }
166
167
168
169
Popular Tags