KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > servletunit > struts > tests > ComplexForm


1 /*
2  * User: dxseale
3  * Date: Nov 7, 2002
4  */

5 package servletunit.struts.tests;
6
7 import org.apache.struts.action.ActionForm;
8 import org.apache.struts.action.ActionMapping;
9
10 import javax.servlet.http.HttpServletRequest JavaDoc;
11
12 public class ComplexForm extends ActionForm {
13
14     private Object JavaDoc complexObject;
15     private String JavaDoc username;
16     private String JavaDoc password;
17
18     public String JavaDoc getUsername() {
19         if (username != null)
20             return username;
21         else
22             return "";
23     }
24
25     public void setUsername(String JavaDoc username) {
26         this.username = username;
27     }
28
29     public String JavaDoc getPassword() {
30         if (password != null)
31             return password;
32         else
33             return "";
34     }
35
36     public void setPassword(String JavaDoc password) {
37         this.password = password;
38     }
39
40     public Object JavaDoc getComplexObject() {
41         return complexObject;
42     }
43
44     public void setComplexObject(Object JavaDoc complexObject) {
45         this.complexObject = complexObject;
46     }
47
48     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
49         String JavaDoc testFlag = request.getParameter("test.reset");
50         if ((testFlag != null) && (testFlag.equals("true"))) {
51             this.setComplexObject(null);
52             this.setPassword(null);
53             this.setUsername(null);
54         }
55     }
56
57
58 }
59
Popular Tags