protected void doDispatch(String dispatchPath, HstRequest request, HstResponse response) throws HstComponentException { if (dispatchPath != null) { try { servletContext.getRequestDispatcher(dispatchPath).include(request, response); } catch (ServletException e) { throw new HstComponentException(e); } catch (IOException e) { throw new HstComponentException(e); } } else { if (log.isDebugEnabled()) { log.debug("The dispatch path is null. The lifecycle phase is {} and the dispatch lifecycle phase is {}", request.getLifecyclePhase(), request.getAttribute(LIFECYCLE_PHASE_ATTRIBUTE)); } } }
@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); } }
protected void doDispatch(String dispatchPath, HstRequest request, HstResponse response) throws HstComponentException { if (dispatchPath != null) { try { getServletContext().getRequestDispatcher(dispatchPath).include(request, response); } catch (ServletException e) { throw new HstComponentException(e); } catch (IOException e) { throw new HstComponentException(e); } } else { if (log.isDebugEnabled()) { log.debug("The dispatch path is null. The lifecycle phase is {} and the dispatch lifecycle phase is {}", request.getLifecyclePhase(), request.getAttribute(LIFECYCLE_PHASE_ATTRIBUTE)); } } }
@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); } }
/** * Returns a proxy ParametersInfo object for the component class which resolves parameter from * HstComponentConfiguration : resolved means that possible property placeholders like ${1} or ${year}, where the * first refers to the first wildcard matcher in a resolved sitemap item, and the latter to a resolved parameter in * the resolved HstSiteMapItem * <p/> * <EM>NOTE: Because the returned ParametersInfo proxy instance is bound to the current request, you MUST NOT store * the returned object in a member variable or session. You should retrieve that per request.</EM> </P> * <p/> * The parameter map used has inherited parameters from ancestor components, which have precedence over child * components) * * @param component the HST component with a ParameterInfo annotation * @param componentConfig the HST component configuration * @param request the HST request * @return the resolved parameter value for this name, or <code>null</null> if not present */ @SuppressWarnings("unchecked") public static <T> T getParametersInfo(HstComponent component, final ComponentConfiguration componentConfig, final HstRequest request) { T parametersInfo = (T) request.getAttribute(PARAMETERS_INFO_ATTRIBUTE); if (parametersInfo != null) { return parametersInfo; } parametersInfo = ParametersInfoUtils.createParametersInfo(component, componentConfig, request); if (parametersInfo != null) { request.setAttribute(PARAMETERS_INFO_ATTRIBUTE, parametersInfo); } return parametersInfo; }
protected PageErrorHandler.Status handleComponentExceptions(PageErrors pageErrors, HstContainerConfig requestContainerConfig, HstComponentWindow window, HstRequest hstRequest, HstResponse hstResponse) { PageErrorHandler pageErrorHandler = (PageErrorHandler) hstRequest.getAttribute(ContainerConstants.CUSTOM_ERROR_HANDLER_PARAM_NAME);
PageErrorHandler pageErrorHandler = (PageErrorHandler) hstRequest.getAttribute(ContainerConstants.CUSTOM_ERROR_HANDLER_PARAM_NAME);
ConfigurationLockInfo lockInfo = (ConfigurationLockInfo) compConfig; if (lockInfo.getLockedBy() != null) { String cmsUserId = (String) request.getAttribute(ContainerConstants.CMS_REQUEST_USER_ID_ATTR); populatingAttributesMap.put(ChannelManagerConstants.HST_LOCKED_BY, lockInfo.getLockedBy()); if (lockInfo.getLockedBy().equals(cmsUserId)) {
attrValue = request.getAttribute(attrName);
attrValue = request.getAttribute(attrName);
if (request.getAttribute(ASYNC_RENDERED_BY_ANCESTOR_FLAG_ATTR_NAME) == Boolean.TRUE) {