/** * @see org.apache.wicket.version.IPageVersionManager#endVersion(boolean) */ public void endVersion(boolean mergeVersion) { versionStarted = false; String sessionId = page.getSession().getId(); if (sessionId != null) { page.getSession().touch(page); } }
/** * @see org.apache.wicket.version.IPageVersionManager#endVersion(boolean) */ public void endVersion(boolean mergeVersion) { versionStarted = false; String sessionId = page.getSession().getId(); if (sessionId != null) { page.getSession().touch(page); } }
protected void onBeforeRender() { super.onBeforeRender(); // If any of the components on page is not stateless, we need to bind the session // before we start rendering components, as then jsessionid won't be appended // for links rendered before first stateful component if (getSession().isTemporary() && !isPageStateless()) { getSession().bind(); } }
private void setNextAvailableId() { setNumericId(getSession().nextPageId()); }
private void setNextAvailableId() { setNumericId(getSession().nextPageId()); }
@Override protected void onBeforeRender() { // Make sure it is really empty renderedComponents = null; // rendering might remove or add stateful components, so clear flag to force reevaluation stateless = null; super.onBeforeRender(); // If any of the components on page is not stateless, we need to bind the session // before we start rendering components, as then jsessionid won't be appended // for links rendered before first stateful component if (getSession().isTemporary() && !peekPageStateless()) { getSession().bind(); } }
@Override protected void onBeforeRender() { // Make sure it is really empty renderedComponents = null; // rendering might remove or add stateful components, so clear flag to force reevaluation stateless = null; super.onBeforeRender(); // If any of the components on page is not stateless, we need to bind the session // before we start rendering components, as then jsessionid won't be appended // for links rendered before first stateful component if (getSession().isTemporary() && !peekPageStateless()) { getSession().bind(); } }
/** * * @see org.apache.wicket.Component#onBeforeRender() */ @Override protected void onBeforeRender() { super.onBeforeRender(); // If any of the components on page is not stateless, we need to bind the session // before we start rendering components, as then jsessionid won't be appended // for links rendered before first stateful component if (getSession().isTemporary() && !peekPageStateless()) { getSession().bind(); } }
/** * This returns a page instance that is rollbacked the number of versions that is specified * compared to the current page. * * This is a rollback including ajax versions. * * @param numberOfVersions * to rollback * @return rollbacked page instance */ public final Page rollbackPage(int numberOfVersions) { Page page = versionManager == null ? this : versionManager.rollbackPage(numberOfVersions); getSession().touch(page); return page; }
/** * This returns a page instance that is rollbacked the number of versions that is specified * compared to the current page. * * This is a rollback including ajax versions. * * @param numberOfVersions * to rollback * @return rollbacked page instance */ public final Page rollbackPage(int numberOfVersions) { Page page = this; if (versionManager != null) { page = versionManager.rollbackPage(numberOfVersions); } getSession().touch(page); return page; }
@Override protected void onInitialize() { super.onInitialize(); final IPageManager pageManager = getSession().getPageManager(); pageManager.touchPage(this); }
@Override protected void onInitialize() { super.onInitialize(); final IPageManager pageManager = getSession().getPageManager(); pageManager.touchPage(this); }
/** * Gets page instance's unique identifier * * @return instance unique identifier */ public PageReference getPageReference() { setStatelessHint(false); // make sure the page will be available on following request getSession().getPageManager().touchPage(this); return new PageReference(numericId); }
/** * Gets page instance's unique identifier * * @return instance unique identifier */ public PageReference getPageReference() { setStatelessHint(false); // make sure the page will be available on following request getSession().getPageManager().touchPage(this); return new PageReference(numericId); }
@Nullable public static PageKey getPageKey() { Page page = getPage(); if (page != null) { String sessionId = page.getSession().getId(); if (sessionId != null) { return new PageKey(sessionId, new PageIdKey(page.getPageId())); } } return null; }
private void setNextAvailableId() { if (getApplication().getSessionSettings().isPageIdUniquePerSession()) { setNumericId(getSession().nextPageId()); } else { // Set the numeric id on this page setNumericId(getPageMap().nextId()); } }
/** * */ private void setNextAvailableId() { if (getApplication().getSessionSettings().isPageIdUniquePerSession()) { setNumericId(getSession().nextPageId()); } else { // Set the numeric id on this page setNumericId(getPageMap().nextId()); } }
/** * Mark this page as modified in the session. If versioning is supported then a new version of * the page will be stored in {@link IPageStore page store} * * @param isInitialization * a flag whether this is a page instantiation */ public void dirty(final boolean isInitialization) { checkHierarchyChange(this); if (getFlag(FLAG_PREVENT_DIRTY)) { return; } final IPageManager pageManager = getSession().getPageManager(); if (!getFlag(FLAG_IS_DIRTY) && (isVersioned() && pageManager.supportsVersioning() || // we need to get pageId for new page instances even when the page doesn't need // versioning, otherwise pages override each other in the page store and back button // support is broken isInitialization)) { setFlag(FLAG_IS_DIRTY, true); setNextAvailableId(); if (isInitialization == false) { pageManager.touchPage(this); } } }
/** * Mark this page as modified in the session. If versioning is supported then a new version of * the page will be stored in {@link IPageStore page store} * * @param isInitialization * a flag whether this is a page instantiation */ public void dirty(final boolean isInitialization) { checkHierarchyChange(this); if (getFlag(FLAG_PREVENT_DIRTY)) { return; } final IPageManager pageManager = getSession().getPageManager(); if (!getFlag(FLAG_IS_DIRTY) && (isVersioned() && pageManager.supportsVersioning() || // we need to get pageId for new page instances even when the page doesn't need // versioning, otherwise pages override each other in the page store and back button // support is broken isInitialization)) { setFlag(FLAG_IS_DIRTY, true); setNextAvailableId(); if (isInitialization == false) { pageManager.touchPage(this); } } }
getSession().getSessionStore().getSessionId(RequestCycle.get().getRequest(), true); getSession().getPageManager().touchPage(this);