Java Doc for MessageStoreInterceptor.java in  » J2EE » webwork-2.2.6 » com » opensymphony » webwork » interceptor » 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 » webwork 2.2.6 » com.opensymphony.webwork.interceptor 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.opensymphony.webwork.interceptor.MessageStoreInterceptor

MessageStoreInterceptor
public class MessageStoreInterceptor implements Interceptor(Code)
An interceptor to store ValidationAware action's messages / errors and field errors into Http Session, such that it will be retrieveable at a later stage. This allows the action's message / errors and field errors to be available longer that just the particular http request.

In the 'STORE' mode, the interceptor will store the ValidationAware action's message / errors and field errors into Http session.

In the 'RETRIEVE' mode, the interceptor will retrieve the stored action's message / errors and field errors and put them back into the ValidationAware action.

The interceptor does nothing in the 'NONE' mode, which is the default.

The operation mode could be switched using :-

1] Setting the iterceptor parameter eg.

 <action name="submitApplication" ...>
 <interceptor-ref name="store">
 <param name="operationMode">l;STORE</param>
 </interceptor-ref>
 <interceptor-ref name="defaultStack" />
 ....
 </action>
 
2] Through request parameter (allowRequestParameterSwitch must be 'true' which is the default)
 // the request will have the operation mode in 'STORE'
 http://localhost:8080/context/submitApplication.action?operationMode=STORE
 
  • allowRequestParameterSwitch - To enable request parameter that could switch the operation mode of this interceptor.
  • requestParameterSwitch - The request parameter that will indicate what mode this interceptor is in.
  • operationMode - The operation mode this interceptor should be in (either 'STORE', 'RETRIEVE' or 'NONE'). 'NONE' being the default.

The following method could be overriden :-

  • getRequestOperationMode - get the operation mode of this interceptor based on the request parameters
  • mergeCollection - merge two collections
  • mergeMap - merge two map
 
 <action name="submitApplication" ....>
 <interceptor-ref name="store">
 <param name="operationMode">STORE</param>
 </interceptor-ref>
 <interceptor-ref name="defaultStack" />
 <result name="input" type="redirect">applicationFailed.action</result>
 <result type="dispatcher">applicationSuccess.jsp</result>
 </action>
 <action name="applicationFailed" ....>
 <interceptor-ref name="store">
 <param name="operationMode">RETRIEVE</param>
 </interceptor-ref>
 <result>applicationFailed.jsp</result>
 </action>
 
 
With the example above, 'submitApplication.action' will have the action messages / errors / field errors stored in the Http Session. Later when needed, (in this case, when 'applicationFailed.action' is fired, it will get the action messages / errors / field errors stored in the Http Session and put them back into the action.
author:
   tmjee
version:
   $Date$ $Id$


Field Summary
final public static  StringNONE
    
final public static  StringRETRIEVE_MODE
    
final public static  StringSTORE_MODE
    
public static  StringactionErrorsSessionKey
    
public static  StringactionMessagesSessionKey
    
public static  StringfieldErrorsSessionKey
    


Method Summary
protected  voidafter(ActionInvocation invocation, String result)
     Handle the storing of field errors / action messages / field errors, which is done after action invocation, and the operationMode is in 'STORE'.
protected  voidbefore(ActionInvocation invocation)
     Handle the retrieving of field errors / action messages / field errors, which is done before action invocation, and the operationMode is 'RETRIEVE'.
public  voiddestroy()
     No operation.
public  booleangetAllowRequestParameterSwitch()
     Returns true if the request parameter (default to operationMode) is used to decide which mode this interceptor should operates in.
public  StringgetOperationModel()
    
protected  StringgetRequestOperationMode(ActionInvocation invocation)
     Get the operationMode through request paramter, if allowRequestParameterSwitch is 'true', else it simply returns 'NONE', meaning its neither in the 'STORE_MODE' nor 'RETRIEVE_MODE'.
public  StringgetRequestParameterSwitch()
     Returns the request parameter string that is used to determine the mode this interceptor should operatoes in.
public  voidinit()
     No operatio9n.
public  Stringintercept(ActionInvocation invocation)
     Intercept the incomming request and store messages into HttpSession / retrieve messages from HttpSession / do nothing depending on the mode this interceptor is operating in.
protected  CollectionmergeCollection(Collection col1, Collection col2)
     Merge col1 and col2 and return the composite Collection.
protected  MapmergeMap(Map map1, Map map2)
    
public  voidsetAllowRequestParameterSwitch(boolean allowRequestParameterSwitch)
     If true allows request parameter (default to operationMode) to decide which mode this interceptor should operates in.
public  voidsetOperationMode(String operationMode)
    
public  voidsetRequestParameterSwitch(String requestParameterSwitch)
     Set the request parameter string that is used to determine the mode this interceptor should operates in .

Field Detail
NONE
final public static String NONE(Code)



RETRIEVE_MODE
final public static String RETRIEVE_MODE(Code)



STORE_MODE
final public static String STORE_MODE(Code)



actionErrorsSessionKey
public static String actionErrorsSessionKey(Code)



actionMessagesSessionKey
public static String actionMessagesSessionKey(Code)



fieldErrorsSessionKey
public static String fieldErrorsSessionKey(Code)





Method Detail
after
protected void after(ActionInvocation invocation, String result) throws Exception(Code)
Handle the storing of field errors / action messages / field errors, which is done after action invocation, and the operationMode is in 'STORE'.
Parameters:
  invocation -
Parameters:
  result -
throws:
  Exception -



before
protected void before(ActionInvocation invocation) throws Exception(Code)
Handle the retrieving of field errors / action messages / field errors, which is done before action invocation, and the operationMode is 'RETRIEVE'.
Parameters:
  invocation -
throws:
  Exception -



destroy
public void destroy()(Code)
No operation.



getAllowRequestParameterSwitch
public boolean getAllowRequestParameterSwitch()(Code)
Returns true if the request parameter (default to operationMode) is used to decide which mode this interceptor should operates in. boolean



getOperationModel
public String getOperationModel()(Code)
Returns the operation mode this interceptor is operating in (valid values are)
  • STORE
  • RETRIEVE
  • NONE (this is the default)
String



getRequestOperationMode
protected String getRequestOperationMode(ActionInvocation invocation)(Code)
Get the operationMode through request paramter, if allowRequestParameterSwitch is 'true', else it simply returns 'NONE', meaning its neither in the 'STORE_MODE' nor 'RETRIEVE_MODE'. String



getRequestParameterSwitch
public String getRequestParameterSwitch()(Code)
Returns the request parameter string that is used to determine the mode this interceptor should operatoes in.
See Also:   setAllowRequestParameterSwitch String



init
public void init()(Code)
No operatio9n.



intercept
public String intercept(ActionInvocation invocation) throws Exception(Code)
Intercept the incomming request and store messages into HttpSession / retrieve messages from HttpSession / do nothing depending on the mode this interceptor is operating in. String



mergeCollection
protected Collection mergeCollection(Collection col1, Collection col2)(Code)
Merge col1 and col2 and return the composite Collection.
Parameters:
  col1 -
Parameters:
  col2 - Collection



mergeMap
protected Map mergeMap(Map map1, Map map2)(Code)
Merge map1 and map2 and return the composite Map
Parameters:
  map1 -
Parameters:
  map2 - Map



setAllowRequestParameterSwitch
public void setAllowRequestParameterSwitch(boolean allowRequestParameterSwitch)(Code)
If true allows request parameter (default to operationMode) to decide which mode this interceptor should operates in.
Parameters:
  allowRequestParameterSwitch -



setOperationMode
public void setOperationMode(String operationMode)(Code)
Set the operation mode this interceptor is operating in (valid values are)
  • STORE
  • RETRIEVE
  • NONE (this is the default)

Parameters:
  operationMode -



setRequestParameterSwitch
public void setRequestParameterSwitch(String requestParameterSwitch)(Code)
Set the request parameter string that is used to determine the mode this interceptor should operates in .
See Also:   setAllowRequestParameterSwitch
Parameters:
  requestParameterSwitch -



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.