Class InternalPathMethodNameResolver
- java.lang.Object
- org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
- org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver
- All Implemented Interfaces:
MethodNameResolver
@Deprecated public class InternalPathMethodNameResolver extends AbstractUrlMethodNameResolver
Deprecated.as of 4.3, in favor of annotation-driven handler methodsSimple implementation ofMethodNameResolverthat maps URL to method name. Although this is the default implementation used by theMultiActionControllerclass (because it requires no configuration), it's bit naive for most applications. In particular, we don't usually want to tie URL to implementation methods.Maps the resource name after the last slash, ignoring an extension. E.g. "/foo/bar/baz.html" to "baz", assuming a "/foo/bar/baz.html" controller mapping to the corresponding MultiActionController handler. method. Doesn't support wildcards.
- Author:
- Rod Johnson, Juergen Hoeller
Field Summary
Fields inherited from class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
logger
Constructor Summary
Constructors Constructor Description InternalPathMethodNameResolver()Deprecated.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected StringextractHandlerMethodNameFromUrlPath(String uri)Deprecated.Extract the handler method name from the given request URI.protected StringgetHandlerMethodNameForUrlPath(String urlPath)Deprecated.Extracts the method name indicated by the URL path.protected StringgetPrefix()Deprecated.Return the common prefix for handler method names.protected StringgetSuffix()Deprecated.Return the common suffix for handler method names.protected StringpostProcessHandlerMethodName(String methodName)Deprecated.Build the full handler method name based on the given method name as indicated by the URL path.voidsetPrefix(String prefix)Deprecated.Specify a common prefix for handler method names.voidsetSuffix(String suffix)Deprecated.Specify a common suffix for handler method names.Methods inherited from class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
getHandlerMethodName, setAlwaysUseFullPath, setUrlDecode, setUrlPathHelper
Constructor Detail
InternalPathMethodNameResolver
public InternalPathMethodNameResolver()
Deprecated.
Method Detail
setPrefix
public void setPrefix(String prefix)
Deprecated.Specify a common prefix for handler method names. Will be prepended to the internal path found in the URL: e.g. internal path "baz", prefix "my" -> method name "mybaz".
setSuffix
public void setSuffix(String suffix)
Deprecated.Specify a common suffix for handler method names. Will be appended to the internal path found in the URL: e.g. internal path "baz", suffix "Handler" -> method name "bazHandler".
getHandlerMethodNameForUrlPath
protected String getHandlerMethodNameForUrlPath(String urlPath)
Deprecated.Extracts the method name indicated by the URL path.- Specified by:
getHandlerMethodNameForUrlPathin 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:
extractHandlerMethodNameFromUrlPath(java.lang.String),postProcessHandlerMethodName(java.lang.String)
extractHandlerMethodNameFromUrlPath
protected String extractHandlerMethodNameFromUrlPath(String uri)
Deprecated.Extract the handler method name from the given request URI. Delegates toWebUtils.extractFilenameFromUrlPath(String).- Parameters:
uri- the request URI (e.g. "/index.html")- Returns:
- the extracted URI filename (e.g. "index")
- See Also:
WebUtils.extractFilenameFromUrlPath(java.lang.String)
postProcessHandlerMethodName
protected String postProcessHandlerMethodName(String methodName)
Deprecated.Build the full handler method name based on the given method name as indicated by the URL path.The default implementation simply applies prefix and suffix. This can be overridden, for example, to manipulate upper case / lower case, etc.
- Parameters:
methodName- the original method name, as indicated by the URL path- Returns:
- the full method name to use
- See Also:
getPrefix(),getSuffix()