Java Doc for ActionForm.java in  » Web-Framework » struts-1.3.8 » org » apache » struts » action » 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 » org.apache.struts.action 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.struts.action.ActionForm

All known Subclasses:   org.apache.struts.webapp.el.exercise.TestBean,  org.apache.struts.webapp.examples.CustomActionForm,  org.apache.struts.validator.ValidatorForm,  org.apache.struts.webapp.example2.LogonForm,  org.apache.struts.action.DynaActionForm,  org.apache.struts.webapp.example.SubscriptionForm,  examples.multibox.MultiboxActionForm,  org.apache.struts.mock.MockFormBean,  examples.simple.SimpleActionForm,  org.apache.struts.webapp.exercise.TestBean,  org.apache.struts.webapp.example2.SubscriptionForm,  org.apache.struts.webapp.example.LogonForm,
ActionForm
abstract public class ActionForm implements Serializable(Code)

An ActionForm is a JavaBean optionally associated with one or more ActionMappings. Such a bean will have had its properties initialized from the corresponding request parameters before the corresponding Action.execute method is called.

When the properties of this bean have been populated, but before the execute method of the Action is called, this bean's validate method will be called, which gives the bean a chance to verify that the properties submitted by the user are correct and valid. If this method finds problems, it returns an error messages object that encapsulates those problems, and the controller servlet will return control to the corresponding input form. Otherwise, the validate method returns null, indicating that everything is acceptable and the corresponding Action.execute method should be called.

This class must be subclassed in order to be instantiated. Subclasses should provide property getter and setter methods for all of the bean properties they wish to expose, plus override any of the public or protected methods for which they wish to provide modified functionality.

Because ActionForms are JavaBeans, subclasses should also implement Serializable, as required by the JavaBean specification. Some containers require that an object meet all JavaBean requirements in order to use the introspection API upon which ActionForms rely.


version:
   $Rev: 471754 $ $Date: 2005-11-12 08:14:24 -0500 (Sat, 12 Nov 2005)
version:
   $


Field Summary
protected transient  MultipartRequestHandlermultipartRequestHandler
    
protected transient  ActionServletservlet
    


Method Summary
public  MultipartRequestHandlergetMultipartRequestHandler()
    

Return the MultipartRequestHandler for this form The reasoning behind this is to give form bean developers control over the lifecycle of their multipart requests through the use of the finish and/or rollback methods of MultipartRequestHandler.

protected  ActionServletgetServlet()
    
public  ActionServletWrappergetServletWrapper()
    

Return the controller servlet instance to which we are attached.

public  voidreset(ActionMapping mapping, ServletRequest request)
    

>Can be used to reset all bean properties to their default state.

public  voidreset(ActionMapping mapping, HttpServletRequest request)
    

Can be used to reset bean properties to their default state, as needed.

public  voidsetMultipartRequestHandler(MultipartRequestHandler multipartRequestHandler)
    
public  voidsetServlet(ActionServlet servlet)
    
public  ActionErrorsvalidate(ActionMapping mapping, ServletRequest request)
    

Can be used to validate the properties that have been set for this non-HTTP request, and return an ActionErrors object that encapsulates any validation errors that have been found.

public  ActionErrorsvalidate(ActionMapping mapping, HttpServletRequest request)
    

Can be used to validate the properties that have been set for this HTTP request, and return an ActionErrors object that encapsulates any validation errors that have been found.


Field Detail
multipartRequestHandler
protected transient MultipartRequestHandler multipartRequestHandler(Code)

The MultipartRequestHandler for this form, can be null.




servlet
protected transient ActionServlet servlet(Code)

The servlet instance to which we are attached.






Method Detail
getMultipartRequestHandler
public MultipartRequestHandler getMultipartRequestHandler()(Code)

Return the MultipartRequestHandler for this form The reasoning behind this is to give form bean developers control over the lifecycle of their multipart requests through the use of the finish and/or rollback methods of MultipartRequestHandler. This method will return null if this form's enctype is not "multipart/form-data".

The org.apache.struts.upload.MultipartRequestHandlerfor this form.
See Also:   org.apache.struts.upload.MultipartRequestHandler



getServlet
protected ActionServlet getServlet()(Code)

Return the servlet instance to which we are attached.

The servlet instance to which we are attached.



getServletWrapper
public ActionServletWrapper getServletWrapper()(Code)

Return the controller servlet instance to which we are attached. as an ActionServletWrapper.

An instance of ActionServletWrapper
See Also:   ActionServletWrapper
since:
   Struts 1.0.1



reset
public void reset(ActionMapping mapping, ServletRequest request)(Code)

>Can be used to reset all bean properties to their default state. This method is called before the properties are repopulated by the controller.

The default implementation attempts to forward to the HTTP version of this method.


Parameters:
  mapping - The mapping used to select this instance
Parameters:
  request - The servlet request we are processing



reset
public void reset(ActionMapping mapping, HttpServletRequest request)(Code)

Can be used to reset bean properties to their default state, as needed. This method is called before the properties are repopulated by the controller.

The default implementation does nothing. In practice, the only properties that need to be reset are those which represent checkboxes on a session-scoped form. Otherwise, properties can be given initial values where the field is declared.

If the form is stored in session-scope so that values can be collected over multiple requests (a "wizard"), you must be very careful of which properties, if any, are reset. As mentioned, session-scope checkboxes must be reset to false for any page where this property is set. This is because the client does not submit a checkbox value when it is clear (false). If a session-scoped checkbox is not proactively reset, it can never be set to false.

This method is not the appropriate place to initialize form value for an "update" type page (this should be done in a setup Action). You mainly need to worry about setting checkbox values to false; most of the time you can leave this method unimplemented.


Parameters:
  mapping - The mapping used to select this instance
Parameters:
  request - The servlet request we are processing



setMultipartRequestHandler
public void setMultipartRequestHandler(MultipartRequestHandler multipartRequestHandler)(Code)

Set the Handler provided for use in dealing with file uploads.


Parameters:
  multipartRequestHandler - The Handler to use for fileuploads.



setServlet
public void setServlet(ActionServlet servlet)(Code)

Set the servlet instance to which we are attached (if servlet is non-null).


Parameters:
  servlet - The new controller servlet, if any



validate
public ActionErrors validate(ActionMapping mapping, ServletRequest request)(Code)

Can be used to validate the properties that have been set for this non-HTTP request, and return an ActionErrors object that encapsulates any validation errors that have been found. If no errors are found, return null or an ActionErrors object with no recorded error messages.

The default implementation attempts to forward to the HTTP version of this method.


Parameters:
  mapping - The mapping used to select this instance
Parameters:
  request - The servlet request we are processing The set of validation errors, if validation failed; an emptyset or null if validation succeeded.



validate
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)(Code)

Can be used to validate the properties that have been set for this HTTP request, and return an ActionErrors object that encapsulates any validation errors that have been found. If no errors are found, return null or an ActionErrors object with no recorded error messages.

The default implementation performs no validation and returns null. Subclasses must override this method to provide any validation they wish to perform.


Parameters:
  mapping - The mapping used to select this instance
Parameters:
  request - The servlet request we are processing The set of validation errors, if validation failed; an emptyset or null if validation succeeded.
See Also:   DynaActionForm



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.