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


java.lang.Object
   com.opensymphony.webwork.dispatcher.mapper.DefaultActionMapper

DefaultActionMapper
public class DefaultActionMapper implements ActionMapper(Code)
Default action mapper implementation, using the standard *.[ext] (where ext usually "action") pattern. The extension is looked up from the WebWork configuration key webwork.action.exection.

To help with dealing with buttons and other related requirements, this mapper (and other ActionMapper s, we hope) has the ability to name a button with some predefined prefix and have that button name alter the execution behaviour. The four prefixes are:

  • Method prefix - method:default
  • Action prefix - action:dashboard
  • Redirect prefix - redirect:cancel.jsp
  • Redirect-action prefix - redirect-action:cancel

In addition to these four prefixes, this mapper also understands the action naming pattern of foo!bar in either the extension form (eg: foo!bar.action) or in the prefix form (eg: action:foo!bar). This syntax tells this mapper to map to the action named foo and the method bar.

Method Prefix

With method-prefix, instead of calling baz action's execute() method (by default if it isn't overriden in xwork.xml to be something else), the baz action's anotherMethod() will be called. A very elegant way determine which button is clicked. Alternatively, one would have submit button set a particular value on the action when clicked, and the execute() method decides on what to do with the setted value depending on which button is clicked.

 
 <ww:form action="baz">
 <ww:textfield label="Enter your name" name="person.name"/>
 <ww:submit value="Create person"/>
 <ww:submit name="method:anotherMethod" value="Cancel"/>
 </ww:form>
 
 

Action prefix

With action-prefix, instead of executing baz action's execute() method (by default if it isn't overriden in xwork.xml to be something else), the anotherAction action's execute() method (assuming again if it isn't overriden with something else in xwork.xml) will be executed.

 
 <ww:form action="baz">
 <ww:textfield label="Enter your name" name="person.name"/>
 <ww:submit value="Create person"/>
 <ww:submit name="action:anotherAction" value="Cancel"/>
 </ww:form>
 
 

Redirect prefix

With redirect-prefix, instead of executing baz action's execute() method (by default it isn't overriden in xwork.xml to be something else), it will get redirected to, in this case to www.google.com. Internally it uses ServletRedirectResult to do the task.

 
 <ww:form action="baz">
 <ww:textfield label="Enter your name" name="person.name"/>
 <ww:submit value="Create person"/>
 <ww:submit name="redirect:www.google.com" value="Cancel"/>
 </ww:form>
 
 

Redirect-action prefix

With redirect-action-prefix, instead of executing baz action's execute() method (by default it isn't overriden in xwork.xml to be something else), it will get redirected to, in this case 'dashboard.action'. Internally it uses ServletRedirectResult to do the task and read off the extension from the webwork.properties.

 
 <ww:form action="baz">
 <ww:textfield label="Enter your name" name="person.name"/>
 <ww:submit value="Create person"/>
 <ww:submit name="redirect-action:dashboard" value="Cancel"/>
 </ww:form>
 
 

author:
   Patrick Lightbody
author:
   tm_jee
version:
   $Date: 2007-03-24 08:16:10 +0100 (Sat, 24 Mar 2007) $ $Id: DefaultActionMapper.java 2872 2007-03-24 07:16:10Z tm_jee $

Inner Class :interface ParameterAction

Field Summary
final static  StringACTION_PREFIX
    
final static  StringMETHOD_PREFIX
    
final static  StringREDIRECT_ACTION_PREFIX
    
final static  StringREDIRECT_PREFIX
    
static  PrefixTrieprefixTrie
    


Method Summary
 StringdropExtension(String name)
    
static  StringgetDefaultExtension()
     Returns null if no extension is specified.
static  ListgetExtensions()
     Returns null if no extension is specified.
public  ActionMappinggetMapping(HttpServletRequest request)
    
 StringgetUri(HttpServletRequest request)
    
public  StringgetUriFromActionMapping(ActionMapping mapping)
    
protected  voidhandleSpecialParameters(HttpServletRequest request, ActionMapping mapping)
     Extension hook, that handle special parameters, namely those with prefix eg.
protected  voidparseNameAndNamespace(String uri, ActionMapping mapping)
    

Field Detail
ACTION_PREFIX
final static String ACTION_PREFIX(Code)



METHOD_PREFIX
final static String METHOD_PREFIX(Code)



REDIRECT_ACTION_PREFIX
final static String REDIRECT_ACTION_PREFIX(Code)



REDIRECT_PREFIX
final static String REDIRECT_PREFIX(Code)



prefixTrie
static PrefixTrie prefixTrie(Code)





Method Detail
dropExtension
String dropExtension(String name)(Code)



getDefaultExtension
static String getDefaultExtension()(Code)
Returns null if no extension is specified.



getExtensions
static List getExtensions()(Code)
Returns null if no extension is specified.



getMapping
public ActionMapping getMapping(HttpServletRequest request)(Code)



getUri
String getUri(HttpServletRequest request)(Code)



getUriFromActionMapping
public String getUriFromActionMapping(ActionMapping mapping)(Code)



handleSpecialParameters
protected void handleSpecialParameters(HttpServletRequest request, ActionMapping mapping)(Code)
Extension hook, that handle special parameters, namely those with prefix eg.
  • action:someAction
  • method:someMethod
  • redirect:http://www.google.com
  • redirect-action:someRedirectAction

Parameters:
  request -
Parameters:
  mapping -



parseNameAndNamespace
protected void parseNameAndNamespace(String uri, ActionMapping mapping)(Code)



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.