Source Code Cross Referenced for SimpleActionForm.java in  » Web-Framework » struts-1.3.8 » examples » simple » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » struts 1.3.8 » examples.simple 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: SimpleActionForm.java 471754 2006-11-06 14:55:09Z husted $
003:         *
004:         * Licensed to the Apache Software Foundation (ASF) under one
005:         * or more contributor license agreements.  See the NOTICE file
006:         * distributed with this work for additional information
007:         * regarding copyright ownership.  The ASF licenses this file
008:         * to you under the Apache License, Version 2.0 (the
009:         * "License"); you may not use this file except in compliance
010:         * with the License.  You may obtain a copy of the License at
011:         *
012:         *  http://www.apache.org/licenses/LICENSE-2.0
013:         *
014:         * Unless required by applicable law or agreed to in writing,
015:         * software distributed under the License is distributed on an
016:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017:         * KIND, either express or implied.  See the License for the
018:         * specific language governing permissions and limitations
019:         * under the License.
020:         */
021:
022:        package examples.simple;
023:
024:        import javax.servlet.http.HttpServletRequest;
025:
026:        import org.apache.struts.action.ActionErrors;
027:        import org.apache.struts.action.ActionForm;
028:        import org.apache.struts.action.ActionMapping;
029:        import org.apache.struts.action.ActionMessage;
030:
031:        /**
032:         * A simple ActionForm
033:         *
034:         * @version $Rev: 471754 $ $Date: 2006-11-06 08:55:09 -0600 (Mon, 06 Nov 2006) $
035:         */
036:        public class SimpleActionForm extends ActionForm {
037:
038:            // ------------------------------------------------------ Instance Variables
039:
040:            /** Name */
041:            private String name = null;
042:
043:            /** Secret */
044:            private String secret = null;
045:
046:            /** Color */
047:            private String color = null;
048:
049:            /** Confirm */
050:            private boolean confirm = false;
051:
052:            /** Rating */
053:            private String rating = null;
054:
055:            /** Message */
056:            private String message = null;
057:
058:            /** Hidden */
059:            private String hidden = null;
060:
061:            // ------------------------------------------------------------ Constructors
062:
063:            /**
064:             * Constructor for MultiboxActionForm.
065:             */
066:            public SimpleActionForm() {
067:                super ();
068:            }
069:
070:            // ---------------------------------------------------------- Public Methods
071:
072:            /**
073:             * Reset all properties to their default values.
074:             *
075:             * @param mapping The mapping used to select this instance
076:             * @param request The servlet request we are processing
077:             */
078:            public void reset(ActionMapping mapping, HttpServletRequest request) {
079:
080:                this .name = null;
081:                this .secret = null;
082:                this .color = null;
083:                this .confirm = false;
084:                this .rating = null;
085:                this .message = null;
086:                this .hidden = null;
087:
088:            }
089:
090:            /**
091:             * Validate the properties that have been set from this HTTP request,
092:             * and return an <code>ActionMessages</code> object that encapsulates any
093:             * validation errors that have been found.  If no errors are found, return
094:             * <code>null</code> or an <code>ActionMessages</code> object with no
095:             * recorded error messages.
096:             *
097:             * @param mapping The mapping used to select this instance
098:             * @param request The servlet request we are processing
099:             *
100:             * @return ActionMessages if any validation errors occurred
101:             */
102:            public ActionErrors validate(ActionMapping mapping,
103:                    HttpServletRequest request) {
104:
105:                ActionErrors errors = new ActionErrors();
106:
107:                // Name must be entered
108:                if ((name == null) || (name.length() < 1)) {
109:                    errors.add("name",
110:                            new ActionMessage("errors.name.required"));
111:                }
112:
113:                // Secret Phrase must be entered
114:                if ((secret == null) || (secret.length() < 1)) {
115:                    errors.add("secret", new ActionMessage(
116:                            "errors.secret.required"));
117:                }
118:
119:                return (errors);
120:
121:            }
122:
123:            // -------------------------------------------------------------- Properties
124:
125:            /**
126:             * Returns the color.
127:             * @return String
128:             */
129:            public String getColor() {
130:                return color;
131:            }
132:
133:            /**
134:             * Returns the confirm.
135:             * @return boolean
136:             */
137:            public boolean getConfirm() {
138:                return confirm;
139:            }
140:
141:            /**
142:             * Returns the hidden.
143:             * @return String
144:             */
145:            public String getHidden() {
146:                return hidden;
147:            }
148:
149:            /**
150:             * Returns the message.
151:             * @return String
152:             */
153:            public String getMessage() {
154:                return message;
155:            }
156:
157:            /**
158:             * Returns the name.
159:             * @return String
160:             */
161:            public String getName() {
162:                return name;
163:            }
164:
165:            /**
166:             * Returns the rating.
167:             * @return String
168:             */
169:            public String getRating() {
170:                return rating;
171:            }
172:
173:            /**
174:             * Returns the secret.
175:             * @return String
176:             */
177:            public String getSecret() {
178:                return secret;
179:            }
180:
181:            /**
182:             * Sets the color.
183:             * @param color The color to set
184:             */
185:            public void setColor(String color) {
186:                this .color = color;
187:            }
188:
189:            /**
190:             * Sets the confirm.
191:             * @param confirm The confirm to set
192:             */
193:            public void setConfirm(boolean confirm) {
194:                this .confirm = confirm;
195:            }
196:
197:            /**
198:             * Sets the hidden.
199:             * @param hidden The hidden to set
200:             */
201:            public void setHidden(String hidden) {
202:                this .hidden = hidden;
203:            }
204:
205:            /**
206:             * Sets the message.
207:             * @param message The message to set
208:             */
209:            public void setMessage(String message) {
210:                this .message = message;
211:            }
212:
213:            /**
214:             * Sets the name.
215:             * @param name The name to set
216:             */
217:            public void setName(String name) {
218:                this .name = name;
219:            }
220:
221:            /**
222:             * Sets the rating.
223:             * @param rating The rating to set
224:             */
225:            public void setRating(String rating) {
226:                this .rating = rating;
227:            }
228:
229:            /**
230:             * Sets the secret.
231:             * @param secret The secret to set
232:             */
233:            public void setSecret(String secret) {
234:                this.secret = secret;
235:            }
236:
237:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.