/** * Build a FreeMarker {@link HttpSessionHashModel} for the given request, * detecting whether a session already exists and reacting accordingly. * @param request current HTTP request * @param response current servlet response * @return the FreeMarker HttpSessionHashModel */ private HttpSessionHashModel buildSessionModel(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(false); if (session != null) { return new HttpSessionHashModel(session, getObjectWrapper()); } else { return new HttpSessionHashModel(null, request, response, getObjectWrapper()); } }
public boolean isEmpty() throws TemplateModelException { checkSessionExistence(); return session == null || !session.getAttributeNames().hasMoreElements(); } }
if (session != null) { sessionModel = (HttpSessionHashModel) session.getAttribute(ATTR_SESSION_MODEL); if (sessionModel == null || sessionModel.isOrphaned(session)) { sessionModel = new HttpSessionHashModel(session, objectWrapper); initializeSessionAndInstallModel(request, response, sessionModel, session); sessionModel = new HttpSessionHashModel(this, request, response, objectWrapper);
/** * Build a FreeMarker {@link HttpSessionHashModel} for the given request, * detecting whether a session already exists and reacting accordingly. * @param request current HTTP request * @param response current servlet response * @return the FreeMarker HttpSessionHashModel */ private HttpSessionHashModel buildSessionModel(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(false); if (session != null) { return new HttpSessionHashModel(session, getObjectWrapper()); } else { return new HttpSessionHashModel(null, request, response, getObjectWrapper()); } }
if(session != null) { sessionModel = (HttpSessionHashModel) session.getAttribute(ATTR_SESSION_MODEL); if (sessionModel == null || sessionModel.isOrphaned(session)) { sessionModel = new HttpSessionHashModel(session, wrapper); initializeSessionAndInstallModel(request, response, sessionModel, session); sessionModel = new HttpSessionHashModel(this, request, response, wrapper);
public TemplateModel get(String key) throws TemplateModelException { checkSessionExistence(); return wrapper.wrap(session != null ? session.getAttribute(key) : null); }
/** * Build a FreeMarker {@link HttpSessionHashModel} for the given request, * detecting whether a session already exists and reacting accordingly. * @param request current HTTP request * @param response current servlet response * @return the FreeMarker HttpSessionHashModel */ private static HttpSessionHashModel buildSessionModel(HttpServletRequest request, HttpServletResponse response) { HttpSessionHashModel model = null; HttpSession session = request.getSession(false); if (session != null) { model = new HttpSessionHashModel(session, ObjectWrapper.DEFAULT_WRAPPER); } else { model = new HttpSessionHashModel(null, request, response, ObjectWrapper.DEFAULT_WRAPPER); } return model; }
if (session != null) { sessionModel = (HttpSessionHashModel) session.getAttribute(ATTR_SESSION_MODEL); if (sessionModel == null || sessionModel.isOrphaned(session)) { sessionModel = new HttpSessionHashModel(session, objectWrapper); initializeSessionAndInstallModel(request, response, sessionModel, session); sessionModel = new HttpSessionHashModel(this, request, response, objectWrapper);
public boolean isEmpty() throws TemplateModelException { checkSessionExistence(); return session == null || !session.getAttributeNames().hasMoreElements(); } }
/** * Build a FreeMarker {@link HttpSessionHashModel} for the given request, * detecting whether a session already exists and reacting accordingly. * @param request current HTTP request * @param response current servlet response * @return the FreeMarker HttpSessionHashModel */ private static HttpSessionHashModel buildSessionModel(HttpServletRequest request, HttpServletResponse response) { HttpSessionHashModel model = null; HttpSession session = request.getSession(false); if (session != null) { model = new HttpSessionHashModel(session, ObjectWrapper.DEFAULT_WRAPPER); } else { model = new HttpSessionHashModel(null, request, response, ObjectWrapper.DEFAULT_WRAPPER); } return model; }
if (session != null) { sessionModel = (HttpSessionHashModel) session.getAttribute(ATTR_SESSION_MODEL); if (sessionModel == null || sessionModel.isOrphaned(session)) { sessionModel = new HttpSessionHashModel(session, objectWrapper); initializeSessionAndInstallModel(request, response, sessionModel, session); sessionModel = new HttpSessionHashModel(this, request, response, objectWrapper);
public boolean isEmpty() throws TemplateModelException { checkSessionExistence(); return session == null || !session.getAttributeNames().hasMoreElements(); } }
/** * Build a FreeMarker {@link HttpSessionHashModel} for the given request, * detecting whether a session already exists and reacting accordingly. * @param request current HTTP request * @param response current servlet response * @return the FreeMarker HttpSessionHashModel */ private HttpSessionHashModel buildSessionModel(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(false); if (session != null) { return new HttpSessionHashModel(session, getObjectWrapper()); } else { return new HttpSessionHashModel(null, request, response, getObjectWrapper()); } }
public boolean isEmpty() throws TemplateModelException { checkSessionExistence(); return session == null || !session.getAttributeNames().hasMoreElements(); } }
root.put("sessionAttributes", new HttpSessionHashModel(session, FreeMarkerWorker.getDefaultOfbizWrapper()));
public TemplateModel get(String key) throws TemplateModelException { checkSessionExistence(); return wrapper.wrap(session != null ? session.getAttribute(key) : null); }
model.put(KEY_SESSION_MODEL, new HttpSessionHashModel(session, wrapper));
public TemplateModel get(String key) throws TemplateModelException { checkSessionExistence(); return wrapper.wrap(session != null ? session.getAttribute(key) : null); }
model.put(KEY_SESSION_MODEL, new HttpSessionHashModel(session, wrapper)); } else {
public TemplateModel get(String key) throws TemplateModelException { checkSessionExistence(); return wrapper.wrap(session != null ? session.getAttribute(key) : null); }