|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver
The most sophisticated and useful framework implementation of the MethodNameResolver interface. Uses java.util.Properties defining the mapping between the URL of incoming requests and method name. Such properties can be held in an XML document.
Properties format is
/welcome.html=displayGenresPage
Note that method overloading isn't allowed, so there's no
need to specify arguments.
Supports direct matches, e.g. a registered "/test" matches "/test", and a various Ant-style pattern matches, e.g. a registered "/t*" matches both "/test" and "/team". For details, see the PathMatcher class.
Properties
,
PathMatcher
Field Summary |
Fields inherited from class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver |
logger |
Constructor Summary | |
PropertiesMethodNameResolver()
|
Method Summary | |
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware). |
protected java.lang.String |
getHandlerMethodNameForUrlPath(java.lang.String urlPath)
Return a method name that can handle this request, based on the given lookup path. |
void |
setMappings(java.util.Properties mappings)
Set URL to method name mappings from a Properties object. |
Methods inherited from class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver |
getHandlerMethodName, setAlwaysUseFullPath, setUrlDecode, setUrlPathHelper |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PropertiesMethodNameResolver()
Method Detail |
public void setMappings(java.util.Properties mappings)
mappings
- properties with URL as key and method name as valuepublic void afterPropertiesSet()
InitializingBean
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet
in interface InitializingBean
protected java.lang.String getHandlerMethodNameForUrlPath(java.lang.String urlPath)
AbstractUrlMethodNameResolver
getHandlerMethodNameForUrlPath
in class AbstractUrlMethodNameResolver
urlPath
- the URL path to use for lookup,
according to the settings in this class
AbstractUrlMethodNameResolver.getHandlerMethodName(javax.servlet.http.HttpServletRequest)
,
AbstractUrlMethodNameResolver.setAlwaysUseFullPath(boolean)
,
AbstractUrlMethodNameResolver.setUrlDecode(boolean)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |