| |
|
| java.lang.Object org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy org.apache.wicket.request.target.coding.HybridUrlCodingStrategy
All known Subclasses: org.apache.wicket.request.target.coding.IndexedHybridUrlCodingStrategy,
HybridUrlCodingStrategy | public class HybridUrlCodingStrategy extends AbstractRequestTargetUrlCodingStrategy (Code) | | An URL coding strategy that encodes the mount point, page parameters and page
instance information into the URL. The benefits compared to mounting page
with
BookmarkablePageRequestTargetUrlCodingStrategy are that the
mount point is preserved even after invoking listener interfaces (thus you
don't lose bookmarkability after clicking links) and that for ajax only pages
the state is preserved on refresh.
The url with
HybridUrlCodingStrategy looks like
/mount/path/param1/value1.3. or /mount/path/param1/value1.3.2 where 3 is page
Id and 2 is version number.
Also to preserve state on refresh with ajax-only pages the
HybridUrlCodingStrategy does an immediate redirect after hitting
bookmarkable URL, e.g. it immediately redirects from /mount/path to
/mount/path.3 where 3 is the next page id. This preserves the page instance
on subsequent page refresh.
author: Matej Knopp |
Inner Class :protected static class PageInfoExtraction | |
Inner Class :protected static class PageInfo | |
HybridUrlCodingStrategy | public HybridUrlCodingStrategy(String mountPath, Class pageClass, boolean redirectOnBookmarkableRequest)(Code) | | Construct.
Parameters: mountPath - Parameters: pageClass - Parameters: redirectOnBookmarkableRequest - whether after hitting the page with URL in bookmarkable formit should be redirected to hybrid URL - needed for ajax towork properly after page refresh |
HybridUrlCodingStrategy | public HybridUrlCodingStrategy(String mountPath, Class pageClass)(Code) | | Construct.
Parameters: mountPath - Parameters: pageClass - |
addPageInfo | protected String addPageInfo(String url, PageInfo pageInfo)(Code) | | Encodes the PageInfo part to the URL
Parameters: url - Parameters: pageInfo - |
alwaysRedirectWhenPageMapIsSpecified | protected boolean alwaysRedirectWhenPageMapIsSpecified()(Code) | | Returns whether to redirect when there is pageMap specified in
bookmarkable URL
|
extractPageInfo | protected PageInfoExtraction extractPageInfo(String url)(Code) | | Extracts the PageInfo string.
Parameters: url - |
getInitialPagePageParameters | public static PageParameters getInitialPagePageParameters(Page page)(Code) | | Parameters: page - |
isRedirectOnBookmarkableRequest | protected boolean isRedirectOnBookmarkableRequest()(Code) | | Returns whether after hitting bookmarkable url the request should be
redirected to a hybrid URL. This is recommended for pages with Ajax.
|
setInitialPageParameters | public static void setInitialPageParameters(Page page, PageParameters pageParameters)(Code) | | Sets the initial page parameters for page instance. Use this only if you
know what you are doing.
Parameters: page - Parameters: pageParameters - |
|
|
|