Spring-Spring MVC1 Comment

ParameterMethodNameResolver, a MultiActionController method name resolver to map URL to method name via request parameter name, and the parameter name is customizable through the “paramName” property. See following example :

  • MultiActionController

A MultiActionController example.

  • ParameterMethodNameResolver

With ParameterMethodNameResolver configured, and define the parameter name thought the “paramName” property:

Now, the URL will map to the method name via the “action” request parameter name :

  1. /customer/*.htm?action=add –> add() method
  2. /customer/whatever.htm?action=add –> add() method
  3. /customer/*.htm?action=update –> update() method
  4. /customer/*.htm?action=delete –> delete() method
  5. /customer/*.htm?action=list –> list() method

P.S the “*” means any text.

By default, MultiActionController is used the InternalPathMethodNameResolver to map URL to the corresponds method name.


1 Comment on this article

Add a comment


Warning: stream_socket_client(): unable to connect to http://browscap.org/version (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in /home/javasail/public_html/wp-content/plugins/wp-statistics/vendor/browscap/browscap-php/src/phpbrowscap/Browscap.php on line 1366

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /home/javasail/public_html/wp-content/plugins/wp-statistics/vendor/browscap/browscap-php/src/phpbrowscap/Browscap.php on line 876