Java Doc for SpringBindingActionForm.java in  » J2EE » spring-framework-2.0.6 » org » springframework » web » struts » 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 » J2EE » spring framework 2.0.6 » org.springframework.web.struts 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.web.struts.SpringBindingActionForm

SpringBindingActionForm
public class SpringBindingActionForm extends ActionForm (Code)
A thin Struts ActionForm adapter that delegates to Spring's more complete and advanced data binder and Errors object underneath the covers to bind to POJOs and manage rejected values.

Exposes Spring-managed errors to the standard Struts view tags, through exposing a corresponding Struts ActionMessages object as request attribute. Also exposes current field values in a Struts-compliant fashion, including rejected values (which Spring's binding keeps even for non-String fields).

Consequently, Struts views can be written in a completely traditional fashion (with standard html:form, html:errors, etc), seamlessly accessing a Spring-bound POJO form object underneath.

Note this ActionForm is designed explicitly for use in request scope. It expects to receive an expose call from the Action, passing in the Errors object to expose plus the current HttpServletRequest.

Example definition in struts-config.xml:

 <form-beans>
 <form-bean name="actionForm" type="org.springframework.web.struts.SpringBindingActionForm"/>
 </form-beans>
Example code in a custom Struts Action:
 public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception {
 SpringBindingActionForm form = (SpringBindingActionForm) actionForm;
 MyPojoBean bean = ...;
 ServletRequestDataBinder binder = new ServletRequestDataBinder(bean, "myPojo");
 binder.bind(request);
 form.expose(binder.getBindingResult(), request);
 return actionMapping.findForward("success");
 }
This class is compatible with both Struts 1.2.x and Struts 1.1. On Struts 1.2, default messages registered with Spring binding errors are exposed when none of the error codes could be resolved. On Struts 1.1, this is not possible due to a limitation in the Struts message facility; hence, we expose the plain default error code there.
author:
   Keith Donald
author:
   Juergen Hoeller
since:
   1.2.2
See Also:   SpringBindingActionForm.expose(org.springframework.validation.Errors,javax.servlet.http.HttpServletRequest)




Method Summary
public  voidexpose(Errors errors, HttpServletRequest request)
     Set the Errors object that this SpringBindingActionForm is supposed to wrap.



Method Detail
expose
public void expose(Errors errors, HttpServletRequest request)(Code)
Set the Errors object that this SpringBindingActionForm is supposed to wrap. The contained field values and errors will be exposed to the view, accessible through Struts standard tags.
Parameters:
  errors - the Spring Errors object to wrap, usually taken froma DataBinder that has been used for populating a POJO form object
Parameters:
  request - the HttpServletRequest to retrieve the attributes from
See Also:   org.springframework.validation.DataBinder.getBindingResult



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