org.riotfamily.pages.mapping
Class SiteBeanNameHandlerMapping
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.handler.AbstractHandlerMapping
org.riotfamily.common.web.mapping.AbstractReverseHandlerMapping
org.riotfamily.common.web.mapping.AdvancedBeanNameHandlerMapping
org.riotfamily.pages.mapping.SiteBeanNameHandlerMapping
- All Implemented Interfaces:
- ReverseHandlerMapping, ApplicationContextAware, Ordered, ServletContextAware, HandlerMapping
public class SiteBeanNameHandlerMapping
- extends AdvancedBeanNameHandlerMapping
AdvancedBeanNameHandlerMapping that can fill in the path prefix of the
current Site.
Lets assume you have a controller with the following mapping:
<bean id="foo" name="${sitePrefix*}/foo.html" ... >
Then writing ${common.urlForHandler('foo')}
in your .ftl will
result in a valid URL, prefixed with the current Site's pathPrefix.
Note: The mapping currently doesn't perform any sanity check upon lookup,
i.e. the pattern above will also match "/bar/baz/foo.html", even though
"/bar/baz" is no valid Site prefix.
- Author:
- flx
Methods inherited from class org.riotfamily.common.web.mapping.AdvancedBeanNameHandlerMapping |
addServletMappingIfNecessary, getLookupPath, getPatternsForHandler, getRootHandler, initApplicationContext, isMapping, isStripServletMapping, lookupHandler, setLazyInitHandlers, setRootHandler, setStripServletMapping |
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping |
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initInterceptors, setDefaultHandler, setInterceptors, setOrder |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SiteBeanNameHandlerMapping
public SiteBeanNameHandlerMapping(PageResolver pageResolver)
getHandlerInternal
public Object getHandlerInternal(HttpServletRequest request)
throws Exception
- Description copied from class:
AdvancedBeanNameHandlerMapping
- Look up a handler for the given request, falling back to the default
handler if no specific one is found.
- Overrides:
getHandlerInternal
in class AdvancedBeanNameHandlerMapping
- Parameters:
request
- current HTTP request
- Returns:
- the looked up handler instance, or the default handler
- Throws:
Exception
getDefaults
protected Map<String,?> getDefaults(UrlResolverContext context)
- Description copied from class:
AbstractReverseHandlerMapping
- Returns a Map of default values that are used to build URLs. The default
implementation return
null
.
- Overrides:
getDefaults
in class AbstractReverseHandlerMapping