Class PropertiesMethodNameResolver
- java.lang.Object
- org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
- org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver
- All Implemented Interfaces:
InitializingBean
,MethodNameResolver
@Deprecated public class PropertiesMethodNameResolver extends AbstractUrlMethodNameResolver implements InitializingBean
Deprecated.as of 4.3, in favor of annotation-driven handler methodsThe most flexible out-of-the-box implementation of theMethodNameResolver
interface. Usesjava.util.Properties
to define the mapping between the URL of incoming requests and the corresponding 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 AntPathMatcher javadoc.
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
Properties
,AntPathMatcher
Field Summary
Fields inherited from class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
logger
Constructor Summary
Constructors Constructor Description PropertiesMethodNameResolver()
Deprecated.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
afterPropertiesSet()
Deprecated.Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.protected String
getHandlerMethodNameForUrlPath(String urlPath)
Deprecated.Return a method name that can handle this request, based on the given lookup path.void
setMappings(Properties mappings)
Deprecated.Set explicit URL to method name mappings through a Properties object.void
setPathMatcher(PathMatcher pathMatcher)
Deprecated.Set the PathMatcher implementation to use for matching URL paths against registered URL patterns.Methods inherited from class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
getHandlerMethodName, setAlwaysUseFullPath, setUrlDecode, setUrlPathHelper
Constructor Detail
PropertiesMethodNameResolver
public PropertiesMethodNameResolver()
Deprecated.
Method Detail
setMappings
public void setMappings(Properties mappings)
Deprecated.Set explicit URL to method name mappings through a Properties object.- Parameters:
mappings
- Properties with URL as key and method name as value
setPathMatcher
public void setPathMatcher(PathMatcher pathMatcher)
Deprecated.Set the PathMatcher implementation to use for matching URL paths against registered URL patterns. Default is AntPathMatcher.- See Also:
AntPathMatcher
afterPropertiesSet
public void afterPropertiesSet()
Deprecated.Description copied from interface:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
getHandlerMethodNameForUrlPath
protected String getHandlerMethodNameForUrlPath(String urlPath)
Deprecated.Description copied from class:AbstractUrlMethodNameResolver
Return a method name that can handle this request, based on the given lookup path. Called bygetHandlerMethodName
.- Specified by:
getHandlerMethodNameForUrlPath
in classAbstractUrlMethodNameResolver
- Parameters:
urlPath
- the URL path to use for lookup, according to the settings in this class- Returns:
- a method name that can handle this request. Should return null if no matching method found.
- See Also:
AbstractUrlMethodNameResolver.getHandlerMethodName(javax.servlet.http.HttpServletRequest)
,AbstractUrlMethodNameResolver.setAlwaysUseFullPath(boolean)
,AbstractUrlMethodNameResolver.setUrlDecode(boolean)