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


java.lang.Object
   org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver

ParameterMethodNameResolver
public class ParameterMethodNameResolver implements MethodNameResolver(Code)
Implementation of MethodNameResolver which supports several strategies for mapping parameter values to the names of methods to invoke.

The simplest strategy looks for a specific named parameter, whose value is considered the name of the method to invoke. The name of the parameter may be specified as a JavaBean property, if the default action is not acceptable.

The alternative strategy uses the very existence of a request parameter ( i.e. a request parameter with a certain name is found) as an indication that a method with the same name should be dispatched to. In this case, the actual request parameter value is ignored. The list of parameter/method names may be set via the methodParamNames JavaBean property.

The second resolution strategy is primarily expected to be used with web pages containing multiple submit buttons. The 'name' attribute of each button should be set to the mapped method name, while the 'value' attribute is normally displayed as the button label by the browser, and will be ignored by the resolver.

Note that the second strategy also supports the use of submit buttons of type 'image'. That is, an image submit button named 'reset' will normally be submitted by the browser as two request paramters called 'reset.x', and 'reset.y'. When checking for the existence of a paramter from the methodParamNames list, to indicate that a specific method should be called, the code will look for request parameter in the "reset" form (exactly as spcified in the list), and in the "reset.x" form ('.x' appended to the name in the list). In this way it can handle both normal and image submit buttons. The actual method name resolved if there is a match will always be the bare form without the ".x".

Note: If both strategies are configured, i.e. both "paramName" and "methodParamNames" are specified, then both will be checked for any given request. A match for an explicit request parameter in the "methodParamNames" list always wins over a value specified for a "paramName" action parameter.

For use with either strategy, the name of a default handler method to use when there is no match, can be specified as a JavaBean property.

For both resolution strategies, the method name is of course coming from some sort of view code, (such as a JSP page). While this may be acceptable, it is sometimes desireable to treat this only as a 'logical' method name, with a further mapping to a 'real' method name. As such, an optional 'logical' mapping may be specified for this purpose.
author:
   Rod Johnson
author:
   Juergen Hoeller
author:
   Colin Sampaleanu
See Also:   ParameterMethodNameResolver.setParamName
See Also:   ParameterMethodNameResolver.setMethodParamNames
See Also:   ParameterMethodNameResolver.setLogicalMappings
See Also:   ParameterMethodNameResolver.setDefaultMethodName



Field Summary
final public static  StringDEFAULT_PARAM_NAME
     Default name for the parameter whose value identifies the method to invoke: "action".
final protected  Loglogger
    


Method Summary
public  StringgetHandlerMethodName(HttpServletRequest request)
    
public  voidsetDefaultMethodName(String defaultMethodName)
    
public  voidsetLogicalMappings(Properties logicalMappings)
     Specifies a set of optional logical method name mappings.
public  voidsetMethodParamNames(String[] methodParamNames)
     Set a String array of parameter names, where the very existence of a parameter in the list (with value ignored) means that a method of the same name should be invoked.
public  voidsetParamName(String paramName)
     Set the name of the parameter whose value identifies the name of the method to invoke.

Field Detail
DEFAULT_PARAM_NAME
final public static String DEFAULT_PARAM_NAME(Code)
Default name for the parameter whose value identifies the method to invoke: "action".



logger
final protected Log logger(Code)





Method Detail
getHandlerMethodName
public String getHandlerMethodName(HttpServletRequest request) throws NoSuchRequestHandlingMethodException(Code)



setDefaultMethodName
public void setDefaultMethodName(String defaultMethodName)(Code)
Set the name of the default handler method that should be used when no parameter was found in the request



setLogicalMappings
public void setLogicalMappings(Properties logicalMappings)(Code)
Specifies a set of optional logical method name mappings. For both resolution strategies, the method name initially comes in from the view layer. If that needs to be treated as a 'logical' method name, and mapped to a 'real' method name, then a name/value pair for that purpose should be added to this Properties instance. Any method name not found in this mapping will be considered to already be the real method name.

Note that in the case of no match, where the ParameterMethodNameResolver.defaultMethodName property is used if available, that method name is considered to already be the real method name, and is not run through the logical mapping.
Parameters:
  logicalMappings - a Properties object mapping logical method names to realmethod names




setMethodParamNames
public void setMethodParamNames(String[] methodParamNames)(Code)
Set a String array of parameter names, where the very existence of a parameter in the list (with value ignored) means that a method of the same name should be invoked. This target method name may then be optionally further mapped via the ParameterMethodNameResolver.logicalMappings property, in which case it can be considered a logical name only.
See Also:   ParameterMethodNameResolver.setParamName



setParamName
public void setParamName(String paramName)(Code)
Set the name of the parameter whose value identifies the name of the method to invoke. Default is "action".

Alternatively, specify parameter names where the very existence of each parameter means that a method of the same name should be invoked, via the "methodParamNames" property.
See Also:   ParameterMethodNameResolver.setMethodParamNames




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.