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