public abstract class

AbstractUrlMethodNameResolver

extends Object
implements MethodNameResolver
java.lang.Object
   ↳ org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver
Known Direct Subclasses

Class Overview

Abstract base class for URL-based MethodNameResolver implementations.

Provides infrastructure for mapping handlers to URLs and configurable URL lookup. For information on the latter, see the setAlwaysUseFullPath(boolean) "alwaysUseFullPath"} and "urlDecode" properties.

Summary

Fields
protected final Log logger Logger available to subclasses
Public Constructors
AbstractUrlMethodNameResolver()
Public Methods
final String getHandlerMethodName(HttpServletRequest request)
Retrieves the URL path to use for lookup and delegates to getHandlerMethodNameForUrlPath.
void setAlwaysUseFullPath(boolean alwaysUseFullPath)
Set if URL lookup should always use full path within current servlet context.
void setUrlDecode(boolean urlDecode)
Set if context path and request URI should be URL-decoded.
void setUrlPathHelper(UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for resolution of lookup paths.
Protected Methods
abstract String getHandlerMethodNameForUrlPath(String urlPath)
Return a method name that can handle this request, based on the given lookup path.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.web.servlet.mvc.multiaction.MethodNameResolver

Fields

protected final Log logger

Logger available to subclasses

Public Constructors

public AbstractUrlMethodNameResolver ()

Public Methods

public final String getHandlerMethodName (HttpServletRequest request)

Retrieves the URL path to use for lookup and delegates to getHandlerMethodNameForUrlPath. Converts null values to NoSuchRequestHandlingMethodExceptions.

Parameters
request current HTTP request
Returns
  • a method name that can handle this request. Never returns null; throws exception if not resolvable.

public void setAlwaysUseFullPath (boolean alwaysUseFullPath)

Set if URL lookup should always use full path within current servlet context. Else, the path within the current servlet mapping is used if applicable (i.e. in the case of a ".../*" servlet mapping in web.xml). Default is "false".

public void setUrlDecode (boolean urlDecode)

Set if context path and request URI should be URL-decoded. Both are returned undecoded by the Servlet API, in contrast to the servlet path.

Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).

public void setUrlPathHelper (UrlPathHelper urlPathHelper)

Set the UrlPathHelper to use for resolution of lookup paths.

Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple MethodNameResolvers and HandlerMappings.

Protected Methods

protected abstract String getHandlerMethodNameForUrlPath (String urlPath)

Return a method name that can handle this request, based on the given lookup path. Called by getHandlerMethodName.

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.