@Override public void doAction(HstRequest request, HstResponse response) throws HstComponentException { doDispatch(getDispatchPathParameter(request, request.getLifecyclePhase()), request, response); if (Boolean.parseBoolean(getParameter(SHARED_REQUEST_ATTRIBUTES_PARAM_NAME, request, null))) { String sharedAttributeNamePrefix = getParameter(SHARED_REQUEST_ATTRIBUTES_SESSION_ATTRIBUTE_NAME_PREFIX_PARAM_NAME, request, DEFAULT_SHARED_REQUEST_ATTRIBUTES_SESSION_ATTRIBUTE_NAME_PREFIX); String sharedAttributeName = sharedAttributeNamePrefix + response.getNamespace(); Map<String, Object> sharedAttrMap = new HashMap<String, Object>(); String attrName = null; Object attrValue = null; for (Enumeration attrNames = request.getAttributeNames(); attrNames.hasMoreElements(); ) { attrName = (String) attrNames.nextElement(); if (!attrName.startsWith("javax.")) { attrValue = request.getAttribute(attrName); if (attrValue != null) { sharedAttrMap.put(attrName, attrValue); } } } request.getSession(true).setAttribute(sharedAttributeName, sharedAttrMap); } }
@Override public void doAction(HstRequest request, HstResponse response) throws HstComponentException { doDispatch(getDispatchPathParameter(request, request.getLifecyclePhase()), request, response); if (Boolean.parseBoolean(getParameter(SHARED_REQUEST_ATTRIBUTES_PARAM_NAME, request, null))) { String sharedAttributeNamePrefix = getParameter(SHARED_REQUEST_ATTRIBUTES_SESSION_ATTRIBUTE_NAME_PREFIX_PARAM_NAME, request, DEFAULT_SHARED_REQUEST_ATTRIBUTES_SESSION_ATTRIBUTE_NAME_PREFIX); String sharedAttributeName = sharedAttributeNamePrefix + response.getNamespace(); Map<String, Object> sharedAttrMap = new HashMap<String, Object>(); String attrName = null; Object attrValue = null; for (Enumeration attrNames = request.getAttributeNames(); attrNames.hasMoreElements(); ) { attrName = (String) attrNames.nextElement(); if (!attrName.startsWith("javax.")) { attrValue = request.getAttribute(attrName); if (attrValue != null) { sharedAttrMap.put(attrName, attrValue); } } } request.getSession(true).setAttribute(sharedAttributeName, sharedAttrMap); } }
hstRequest.getSession(true).setAttribute(modelAndViewOfActionSessionAttributeName, mv);
hstRequest.getSession(true).setAttribute(modelAndViewOfActionSessionAttributeName, mv);
HttpSession session = request.getSession(false);
HttpSession session = request.getSession(false);
@Override public void process(final HstComponentWindow rootWindow, final HstComponentWindow rootRenderingWindow, final HstComponentWindow window, final HstRequest request, final HstResponse response) { if (!isCmsRequest(request)) { return; } HttpSession session = request.getSession(false); if (session == null) { throw new IllegalStateException("HttpSession should never be null here."); } // we are in render host mode. Add the wrapper elements that are needed for the composer around all components HstComponentConfiguration compConfig = ((HstComponentConfiguration) window.getComponentInfo()); if (isContainerOrContainerItem(compConfig)) { if (isComposerMode(request)) { populateComponentMetaData(request, response, window); } } else if (isTopHstResponse(rootWindow, rootRenderingWindow, window)) { populatePageMetaData(request, response, session, compConfig); } }