/** * @see org.apache.wicket.page.IPageManagerContext#setSessionAttribute(java.lang.String, * java.io.Serializable) */ @Override public void setSessionAttribute(String key, Serializable value) { Session.get().setAttribute(key, value); } }
/** * @see org.apache.wicket.page.IPageManagerContext#setSessionAttribute(java.lang.String, * java.io.Serializable) */ @Override public void setSessionAttribute(String key, Serializable value) { Session.get().setAttribute(key, value); } }
public Object getToken() { Serializable token = getSession().getAttribute(TOKEN_NAME); if (token == null) { //Generate a unique ID for CSRF form submissions token = UUID.randomUUID().toString(); getSession().setAttribute(TOKEN_NAME, token); } return token; } }
protected Map<String, String> hintsFor(final Bookmark bookmark) { final String sessionAttribute = sessionAttributeFor(bookmark); LinkedHashMap<String, String> hints = (LinkedHashMap<String, String>) Session.get().getAttribute(sessionAttribute); if(hints == null) { hints = Maps.newLinkedHashMap(); Session.get().setAttribute(sessionAttribute, hints); } return hints; }
setAttribute(SESSION_ATTRIBUTE_NAME, this); setAttribute((String)entry.getKey(), entry.getValue());
/** * Copies all given source {@link org.apache.wicket.request.mapper.parameter.PageParameters} to * the given session {@link org.apache.wicket.Session}. * * @param source * The source {@link org.apache.wicket.request.mapper.parameter.PageParameters}. * @param session * The session where the * {@link org.apache.wicket.request.mapper.parameter.PageParameters} are stored. */ public static void copyToWicketSession(final PageParameters source, final Session session) { final List<INamedParameters.NamedPair> namedPairs = source.getAllNamed(); for (final INamedParameters.NamedPair namedPair : namedPairs) { session.setAttribute(namedPair.getKey(), namedPair.getValue()); } }
setAttribute(SESSION_ATTRIBUTE_NAME, this); setAttribute(entry.getKey(), entry.getValue());
/** * Creates a new page map with a given name * * @param name * The name for the new page map * @return The newly created page map */ public final IPageMap newPageMap(final String name) { // Check that session doesn't have too many page maps already final int maxPageMaps = getApplication().getSessionSettings().getMaxPageMaps(); synchronized (usedPageMaps) { if (usedPageMaps.size() >= maxPageMaps) { IPageMap pm = (IPageMap)usedPageMaps.getFirst(); pm.remove(); } } // Create new page map final IPageMap pageMap = getSessionStore().createPageMap(name); setAttribute(attributeForPageMapName(name), pageMap); dirty(); return pageMap; }
setAttribute(attributeForPageMapName(name), pageMap);
session.setAttribute(attribute, entry);
session.setAttribute(attribute, entry);