/** * Whether this session is temporary. A Wicket application can operate in a session-less mode as * long as stateless pages are used. If this session object is temporary, it will not be * available on a next request. * * @return Whether this session is temporary (which is the same as it's id being null) */ public final boolean isTemporary() { return getId() == null; }
/** * Whether this session is temporary. A Wicket application can operate in a session-less mode as * long as stateless pages are used. If this session object is temporary, it will not be * available on a next request. * * @return Whether this session is temporary (which is the same as it's id being null) */ public final boolean isTemporary() { return getId() == null; }
/** * Whether this session is temporary. A Wicket application can operate in a session-less mode as * long as stateless pages are used. If this session object is temporary, it will not be * available on a next request. * * @return Whether this session is temporary (which is the same as it's id being null) */ public final boolean isTemporary() { return getId() == null; }
/** * Whether this session is temporary. A Wicket application can operate in a session-less mode as * long as stateless pages are used. If this session object is temporary, it will not be * available on a next request. * * @return Whether this session is temporary (which is the same as it's id being null) */ public final boolean isTemporary() { return getId() == null; }
private void refreshId() { // refresh the session id in case a container like tomcat tries to be smart by doing // session fixation protection by changing the session id. // first, clear the id: id = null; // then re-read the id from the underlying http session: getId(); }
/** * @see org.apache.wicket.page.IPageManagerContext#getSessionId() */ @Override public String getSessionId() { return Session.get().getId(); }
/** * @see org.apache.wicket.page.IPageManagerContext#getSessionId() */ @Override public String getSessionId() { return Session.get().getId(); }
/** * @return the current session id for stateful pages and <code>null</code> for stateless pages */ protected String getSessionId() { return Session.exists() ? Session.get().getId() : null; }
/** * @return the current session id for stateful pages and <code>null</code> for stateless pages */ protected String getSessionId() { return Session.exists() ? Session.get().getId() : null; }
@Override public void notifyObserverChange(BasePage page) { String sessionId = page.getSession().getId(); if (sessionId != null) { Map<IKey, Collection<String>> sessionPages = observables.get(sessionId); if (sessionPages == null) { sessionPages = new ConcurrentHashMap<>(); observables.put(sessionId, sessionPages); } sessionPages.put(new PageIdKey(page.getPageId()), page.findWebSocketObservables()); } }
/** * Get temporary directory path for storing temporary files for e.g images. * * @return temporary directory path for storing temporary files for e.g images. */ public static String getTemporaryDirPath() { ServletContext servletContext = WebApplication.get().getServletContext(); return ((File)servletContext.getAttribute("javax.servlet.context.tempdir")).getPath() + File.separatorChar + Session.get().getId() + File.separatorChar; }
/** * Get temporary directory path for storing temporary files for e.g images. * * @return temporary directory path for storing temporary files for e.g images. */ public static String getTemporaryDirPath() { ServletContext servletContext = WebApplication.get().getServletContext(); return ((File)servletContext.getAttribute("javax.servlet.context.tempdir")).getPath() + File.separatorChar + Session.get().getId() + File.separatorChar; }
/** * @see org.apache.wicket.protocol.http.HttpSessionStore#createPageMap(java.lang.String, * org.apache.wicket.Session) */ public IPageMap createPageMap(String name) { return new SecondLevelCachePageMap(Session.get().getId(), Application.get(), name); }
/** * @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.protocol.http.HttpSessionStore#createPageMap(java.lang.String, * org.apache.wicket.Session) */ @Override public IPageMap createPageMap(String name) { return new SecondLevelCachePageMap(Session.get().getId(), Application.get(), name); }
@Override protected void onBeforeRender() { String sessionId = Session.get().getId(); String uploadUrl = ";jsessionid=" + sessionId + urlFor(uploadBehavior, IBehaviorListener.INTERFACE).toString(); settings.setUploadUrl(uploadUrl); super.onBeforeRender(); }
@Override public void onRequest() { RequestCycle.get().scheduleRequestHandlerAfterCurrent(EmptyAjaxRequestHandler.getInstance()); getLogger().info(String.format("Keeping session with id %s alive.", Session.get().getId())); }
@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; }
public AttachmentResource lookupAttachmentSharedResourceOnCurrentSession() { ResourceReference resourceReference = getSharedResources().get(Session.get().getId()); if (resourceReference == null) { return addAttachmentSharedResourceToCurrentSession(); } else { return (AttachmentResource) resourceReference.getResource(); } }
/** * @see org.apache.wicket.PageMap#removeEntry(org.apache.wicket.session.pagemap.IPageMapEntry) */ public void removeEntry(IPageMapEntry entry) { String sessionId = getSession().getId(); if (sessionId != null) { getStore().removePage(sessionId, getName(), entry.getNumericId()); } }