private Session getSession() { return request.getSession(false); } }
public boolean getHasSession() { return request.getSession(false) != null; }
protected Session getSession() { return request.getSession(true); }
public JSLocatorImpl(Logger logger, Request request) { this.logger = logger; this.request = request; Session session = request.getSession(true); }
public Session getSession(boolean create) { return request.getSession(create); }
public Session getSession() { return request.getSession(false); }
public void requestDidComplete() { Session session = request.getSession(false); if (session != null) session.restoreDirtyObjects(); } }
private Session session() { return request.getSession(false); } }
protected void train_getSession(Request request, boolean create, Session session) { expect(request.getSession(create)).andReturn(session); }
public void set(Object instance, InstanceContext context, Object newValue) { request.getSession(true).setAttribute(key, newValue); }
public String find(String path) { Session session = request.getSession(false); if(session != null){ String script = (String) session.getAttribute(path); session.setAttribute(path, null); return script; } return null; }
public <T> T getIfExists(Class<T> ssoClass) { Session session = request.getSession(false); if (session != null) { String key = buildKey(ssoClass); Object sso = session.getAttribute(key); return sso != null ? (T)sso : null; } return null; }
public void discardChanges(String pageName) { Session session = request.getSession(false); if (session == null) return; String fullPrefix = prefix + pageName + ":"; for (String name : session.getAttributeNames(fullPrefix)) { session.setAttribute(name, null); } }
public String getPersistedEntityClassName() { final Session session = request.getSession(true); final Object value = session.getAttribute("sso:" + User.class.getName()); return value.getClass().getName(); } }
public String getPersistedEntityClassName() { final Session session = request.getSession(true); final Object value = session.getAttribute("sso:" + User.class.getName()); return value.getClass().getName(); } }
public <T> boolean exists(Class<T> ssoClass) { Session session = request.getSession(false); return session != null && !session.isInvalidated() && session.getAttribute(buildKey(ssoClass)) != null; } }
public String getPersistedEntityClassName() { Session session = request.getSession(true); Object value = session.getAttribute("sso:"+User.class.getName()); System.err.println("getPersistedEntityClassName(): "+value); return value.getClass().getName(); } }
public Track getAnotherTrack(){ return (Track) request.getSession(true).getAttribute("track_in_session"); } }
@Test public void get_session_doesnt_exist() { HttpServletRequest sr = mockHttpServletRequest(); TapestrySessionFactory sf = newMock(TapestrySessionFactory.class); expect(sf.getSession(false)).andReturn(null); replay(); Request request = new RequestImpl(sr, CHARSET, sf); assertNull(request.getSession(false)); verify(); }
@Test public void force_session_create() { HttpServletRequest sr = mockHttpServletRequest(); TapestrySessionFactory sf = newMock(TapestrySessionFactory.class); Session session = mockSession(); expect(sf.getSession(true)).andReturn(session); replay(); Request request = new RequestImpl(sr, CHARSET, sf); assertSame(request.getSession(true), session); verify(); }