KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quikj > application > web > talk > jspbeans > ContactCenterEmailForm


1 /*
2  * ContactCenterEmailForm.java
3  *
4  * Created on April 17, 2004, 9:52 AM
5  */

6
7 package com.quikj.application.web.talk.jspbeans;
8
9 import javax.servlet.http.*;
10 /**
11  *
12  * @author amit
13  */

14 public class ContactCenterEmailForm
15 {
16     
17     /** Holds value of property email. */
18     private String JavaDoc email = "";
19     
20     /** Holds value of property subject. */
21     private String JavaDoc subject = "";
22     
23     /** Holds value of property message. */
24     private String JavaDoc message = "";
25     
26     /** Holds value of property formError. */
27     private boolean formError = false;
28     
29     /** Creates a new instance of ContactCenterEmailForm */
30     public ContactCenterEmailForm()
31     {
32     }
33     
34     public void populate(HttpServletRequest request)
35     {
36         email = request.getParameter("from");
37         if (email == null)
38         {
39             formError = true;
40             email = "";
41         }
42         else if (email.trim().length() == 0)
43         {
44             formError = true;
45         }
46         else
47         {
48             email = email.trim();
49         }
50         
51         subject = request.getParameter("subject");
52         if (subject == null)
53         {
54             subject = "";
55         }
56         
57         message = request.getParameter("body");
58         if (message == null)
59         {
60             formError = true;
61             message = "";
62         }
63         else if (message.trim().length() == 0)
64         {
65             formError = true;
66         }
67     }
68     
69     /** Getter for property email.
70      * @return Value of property email.
71      *
72      */

73     public String JavaDoc getEmail()
74     {
75         return this.email;
76     }
77     
78     /** Setter for property email.
79      * @param email New value of property email.
80      *
81      */

82     public void setEmail(String JavaDoc email)
83     {
84         this.email = email;
85     }
86     
87     /** Getter for property subject.
88      * @return Value of property subject.
89      *
90      */

91     public String JavaDoc getSubject()
92     {
93         return this.subject;
94     }
95     
96     /** Setter for property subject.
97      * @param subject New value of property subject.
98      *
99      */

100     public void setSubject(String JavaDoc subject)
101     {
102         this.subject = subject;
103     }
104     
105     /** Getter for property message.
106      * @return Value of property message.
107      *
108      */

109     public String JavaDoc getMessage()
110     {
111         return this.message;
112     }
113     
114     /** Setter for property message.
115      * @param message New value of property message.
116      *
117      */

118     public void setMessage(String JavaDoc message)
119     {
120         this.message = message;
121     }
122     
123     /** Getter for property formError.
124      * @return Value of property formError.
125      *
126      */

127     public boolean isFormError()
128     {
129         return this.formError;
130     }
131     
132     /** Setter for property formError.
133      * @param formError New value of property formError.
134      *
135      */

136     public void setFormError(boolean formError)
137     {
138         this.formError = formError;
139     }
140     
141 }
142
Popular Tags