public class MountedMapper extends AbstractBookmarkableMapper
/mount/${foo}/path. In that case the appropriate segment from the URL will be
accessible as named parameter "foo" in the PageParameters. Similarly when the URL is
constructed, the second segment will contain the value of the "foo" named page parameter.
Optional parameters are denoted by using a # instead of $: /mount/#{foo}/path/${bar}
has an optional foo parameter, a fixed /path/ part and a required bar
parameter. When in doubt, parameters are matched from left to right, where required parameters
are matched before optional parameters, and optional parameters eager (from left to right).
Decodes and encodes the following URLs:
Page Class - Render (BookmarkablePageRequestHandler for mounted pages) /mount/point (these will redirect to hybrid alternative if page is not stateless) IPage Instance - Render Hybrid (RenderPageRequestHandler for mounted pages) /mount/point?2 IPage Instance - Bookmarkable Listener (BookmarkableListenerInterfaceRequestHandler for mounted pages) /mount/point?2-click-foo-bar-baz /mount/point?2-5.click.1-foo-bar-baz (1 is behavior index, 5 is render count) (these will redirect to hybrid if page is not stateless)
AbstractBookmarkableMapper.MountPathSegment, AbstractBookmarkableMapper.UrlInfomountSegments, pageParametersEncoder, pathSegments| Constructor and Description |
|---|
MountedMapper(String mountPath,
Class<? extends IRequestablePage> pageClass)
Construct.
|
MountedMapper(String mountPath,
Class<? extends IRequestablePage> pageClass,
IPageParametersEncoder pageParametersEncoder)
Construct.
|
MountedMapper(String mountPath,
IProvider<Class<? extends IRequestablePage>> pageClassProvider)
Construct.
|
MountedMapper(String mountPath,
IProvider<Class<? extends IRequestablePage>> pageClassProvider,
IPageParametersEncoder pageParametersEncoder)
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
protected Url |
buildUrl(AbstractBookmarkableMapper.UrlInfo info)
Builds URL for the given
AbstractBookmarkableMapper.UrlInfo instance. |
protected boolean |
checkPageClass(Class<? extends IRequestablePage> pageClass) |
Url |
mapHandler(IRequestHandler requestHandler) |
protected PageParameters |
newPageParameters() |
protected boolean |
pageMustHaveBeenCreatedBookmarkable()
Indicates whether hybrid
RenderPageRequestHandler URL for page will be generated only
if page has been created with bookmarkable URL. |
protected AbstractBookmarkableMapper.UrlInfo |
parseRequest(Request request)
Parse the given request to an
AbstractBookmarkableMapper.UrlInfo instance. |
protected boolean |
redirectFromHomePage()
If this method returns
true and application home page class is same as the class
mounted with this encoder, request to home page will result in a redirect to the mounted
path. |
String |
toString() |
checkPageInstance, extractPageParameters, getCompatibilityScore, getMatchedSegmentSizes, getPageInfo, getPathSegments, isCaseSensitiveMatch, isFixedSegment, mapRequest, processBookmarkable, processHybrid, processListener, segmentsMatch, setCaseSensitiveMatch, setPlaceholders, urlStartsWithMountedSegmentscleanClassName, encodePageComponentInfo, getContext, getPageClass, getPageComponentInfo, removeMetaParameter, requestListenerInterfaceFromString, requestListenerInterfaceToStringencodePageParameters, extractPageParameters, getMountSegments, getOptionalPlaceholder, getPlaceholder, getPlaceholder, urlStartsWithpublic MountedMapper(String mountPath, Class<? extends IRequestablePage> pageClass)
mountPath - pageClass - public MountedMapper(String mountPath, IProvider<Class<? extends IRequestablePage>> pageClassProvider)
mountPath - pageClassProvider - public MountedMapper(String mountPath, Class<? extends IRequestablePage> pageClass, IPageParametersEncoder pageParametersEncoder)
mountPath - pageClass - pageParametersEncoder - public MountedMapper(String mountPath, IProvider<Class<? extends IRequestablePage>> pageClassProvider, IPageParametersEncoder pageParametersEncoder)
mountPath - pageClassProvider - pageParametersEncoder - protected AbstractBookmarkableMapper.UrlInfo parseRequest(Request request)
AbstractBookmarkableMapperAbstractBookmarkableMapper.UrlInfo instance.parseRequest in class AbstractBookmarkableMappernull if this encoder can not handle the requestprotected PageParameters newPageParameters()
public Url mapHandler(IRequestHandler requestHandler)
mapHandler in interface IRequestMappermapHandler in class AbstractBookmarkableMapperprotected Url buildUrl(AbstractBookmarkableMapper.UrlInfo info)
AbstractBookmarkableMapperAbstractBookmarkableMapper.UrlInfo instance. The URL this method produces must be
parseable by the AbstractBookmarkableMapper.parseRequest(Request) method.buildUrl in class AbstractBookmarkableMapperAbstractBookmarkableMapper.buildUrl(AbstractBookmarkableMapper.UrlInfo)protected boolean redirectFromHomePage()
true and application home page class is same as the class
mounted with this encoder, request to home page will result in a redirect to the mounted
path.protected boolean pageMustHaveBeenCreatedBookmarkable()
AbstractBookmarkableMapperRenderPageRequestHandler URL for page will be generated only
if page has been created with bookmarkable URL.
For generic bookmarkable encoders this method should return true. For explicit
(mounted) encoders this method should return false
pageMustHaveBeenCreatedBookmarkable in class AbstractBookmarkableMappertrue if hybrid URL requires page created bookmarkable,
false otherwise.AbstractBookmarkableMapper.pageMustHaveBeenCreatedBookmarkable()protected boolean checkPageClass(Class<? extends IRequestablePage> pageClass)
checkPageClass in class AbstractBookmarkableMapperAbstractBookmarkableMapper.checkPageClass(java.lang.Class)Copyright © 2006–2014 Apache Software Foundation. All rights reserved.