|
||||||||||
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.InternalPathMethodNameResolver
public class InternalPathMethodNameResolver
Simple implementation of MethodNameResolver
that maps URL to
method name. Although this is the default implementation used by the
MultiActionController
class (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.
Field Summary |
---|
Fields inherited from class org.springframework.web.servlet.mvc.multiaction.AbstractUrlMethodNameResolver |
---|
logger |
Constructor Summary | |
---|---|
InternalPathMethodNameResolver()
|
Method Summary | |
---|---|
protected String |
extractHandlerMethodNameFromUrlPath(String uri)
Extract the handler method name from the given request URI. |
protected String |
getHandlerMethodNameForUrlPath(String urlPath)
Extracts the method name indicated by the URL path. |
protected String |
getPrefix()
Return the common prefix for handler method names. |
protected String |
getSuffix()
Return the common suffix for handler method names. |
protected String |
postProcessHandlerMethodName(String methodName)
Build the full handler method name based on the given method name as indicated by the URL path. |
void |
setPrefix(String prefix)
Specify a common prefix for handler method names. |
void |
setSuffix(String suffix)
Specify a common suffix for handler method names. |
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 InternalPathMethodNameResolver()
Method Detail |
---|
public void setPrefix(String prefix)
protected String getPrefix()
public void setSuffix(String suffix)
protected String getSuffix()
protected String getHandlerMethodNameForUrlPath(String urlPath)
getHandlerMethodNameForUrlPath
in class AbstractUrlMethodNameResolver
urlPath
- the URL path to use for lookup,
according to the settings in this class
extractHandlerMethodNameFromUrlPath(java.lang.String)
,
postProcessHandlerMethodName(java.lang.String)
protected String extractHandlerMethodNameFromUrlPath(String uri)
WebUtils.extractViewNameFromUrlPath(String)
.
uri
- the request URI (e.g. "/index.html")
WebUtils.extractFilenameFromUrlPath(java.lang.String)
protected String postProcessHandlerMethodName(String methodName)
The default implementation simply applies prefix and suffix. This can be overridden, for example, to manipulate upper case / lower case, etc.
methodName
- the original method name, as indicated by the URL path
getPrefix()
,
getSuffix()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |