KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > examples > app1 > AddressForm


1 /*
2  * Copyright 2003 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 examples.app1;
18
19
20 import javax.servlet.http.HttpServletRequest JavaDoc;
21 import org.apache.struts.action.ActionError;
22 import org.apache.struts.action.ActionErrors;
23 import org.apache.struts.action.ActionForm;
24 import org.apache.struts.action.ActionMapping;
25
26 import java.util.ArrayList JavaDoc;
27
28
29 /**
30  * <p>A simple form that allows a user to enter and modify an address.</p>
31  *
32  * @author <a HREF="mailto:sidler@teamup.com"/>Gabe Sidler</a>
33  * @version $Id: AddressForm.java,v 1.2 2004/02/20 12:42:47 marino Exp $
34  */

35
36 public final class AddressForm extends ActionForm
37 {
38
39     // ---- Form fields -------------------------------------------------
40

41     private String JavaDoc action = "";
42
43     private String JavaDoc firstname = "";
44
45     private String JavaDoc lastname = "";
46
47     private String JavaDoc street = "";
48
49     private String JavaDoc zip = "";
50
51     private String JavaDoc city = "";
52
53     private String JavaDoc country = "";
54
55     private String JavaDoc locale = "";
56
57     private String JavaDoc[] languages;
58
59
60     // ---- Accessor Methods --------------------------------------------
61

62     public String JavaDoc getAction()
63     {
64         return action;
65     }
66
67     public void setAction(String JavaDoc s)
68     {
69         action = s;
70     }
71
72     public String JavaDoc getFirstname()
73     {
74         return firstname;
75     }
76
77     public void setFirstname(String JavaDoc s)
78     {
79         firstname = s;
80     }
81
82     public String JavaDoc getLastname()
83     {
84         return lastname;
85     }
86
87     public void setLastname(String JavaDoc s)
88     {
89         lastname = s;
90     }
91
92     public String JavaDoc getStreet()
93     {
94         return street;
95     }
96
97     public void setStreet(String JavaDoc s)
98     {
99         street = s;
100     }
101
102     public String JavaDoc getZip()
103     {
104         return zip;
105     }
106
107     public void setZip(String JavaDoc s)
108     {
109         zip = s;
110     }
111
112     public String JavaDoc getCity()
113     {
114         return city;
115     }
116
117     public void setCity(String JavaDoc s)
118     {
119         city = s;
120     }
121
122     public String JavaDoc getCountry()
123     {
124         return country;
125     }
126
127     public void setCountry(String JavaDoc s)
128     {
129         country = s;
130     }
131
132     public String JavaDoc getLocale()
133     {
134         return locale;
135     }
136
137     public void setLocale(String JavaDoc s)
138     {
139         locale = s;
140     }
141
142     public String JavaDoc[] getLanguages()
143     {
144         return languages;
145     }
146
147     public void setLanguages(String JavaDoc[] s)
148     {
149         languages = s;
150     }
151
152
153     /**
154      * Reset all properties to their default values.
155      *
156      * @param mapping The mapping used to select this instance
157      * @param request The servlet request we are processing
158      */

159     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request)
160     {
161
162         action = "";
163         locale = "";
164         firstname = "";
165         lastname = "";
166         street = "";
167         zip = "";
168         city = "";
169         country = "";
170
171     }
172
173 }
174
175
176
Popular Tags