public class CustomHomeMapper extends HomePageMapper
IRequestMapper
that handles requests to the home page ('/') and appends the string
representation of the current session locale in the URL
I.e. a request to http://example.com/app will end up in http://example.com/app/en_US
AbstractBookmarkableMapper.MountPathSegment, AbstractBookmarkableMapper.UrlInfo
mountSegments, pageParametersEncoder, pathSegments
Constructor and Description |
---|
CustomHomeMapper(Class<? extends IRequestablePage> pageClass)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getCompatibilityScore(Request request)
If there is just one url segment (the locale?!) then return a bigger compatibility score than
HomePageMapper.getCompatibilityScore(Request) |
Url |
mapHandler(IRequestHandler requestHandler)
Sets the current session Locale as first segment in the Url.
|
IRequestHandler |
mapRequest(Request request)
Removes the leading segment if it a valid Locale
|
parseRequest
buildUrl, checkPageClass, pageMustHaveBeenCreatedBookmarkable, redirectFromHomePage, toString
checkPageInstance, extractPageParameters, getMatchedSegmentSizes, getPageInfo, getPathSegments, isCaseSensitiveMatch, isFixedSegment, newPageParameters, processBookmarkable, processHybrid, processListener, resolveUserLocale, segmentsMatch, setCaseSensitiveMatch, setPlaceholders, urlStartsWithMountedSegments
cleanClassName, encodePageComponentInfo, getContext, getPageClass, getPageComponentInfo, removeMetaParameter
encodePageParameters, extractPageParameters, getMountSegments, getOptionalPlaceholder, getPlaceholder, getPlaceholder, resolveLocale, safeSegmentGetter, urlStartsWith
public CustomHomeMapper(Class<? extends IRequestablePage> pageClass)
pageClass
- the class of the home pagepublic Url mapHandler(IRequestHandler requestHandler)
mapHandler
in interface IRequestMapper
mapHandler
in class MountedMapper
null
.MountedMapper.mapHandler(org.apache.wicket.request.IRequestHandler)
public IRequestHandler mapRequest(Request request)
mapRequest
in interface IRequestMapper
mapRequest
in class AbstractBookmarkableMapper
request
- provides access to request data (i.e. Url and Parameters)null
AbstractBookmarkableMapper.mapRequest(org.apache.wicket.request.Request)
public int getCompatibilityScore(Request request)
HomePageMapper.getCompatibilityScore(Request)
getCompatibilityScore
in interface IRequestMapper
getCompatibilityScore
in class HomePageMapper
HomePageMapper.getCompatibilityScore(org.apache.wicket.request.Request)
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.