public void init(ServletContext servletContext, ComponentConfiguration componentConfig) throws HstComponentException { super.init(servletContext, componentConfig); this.servletContext = servletContext; }
@Override public void destroy() throws HstComponentException { this.delegatedBeanApplicationContext = null; if (delegatedBean != null) { delegatedBean.destroy(); delegatedBean = null; } super.destroy(); }
@Override public void doBeforeServeResource(HstRequest request, HstResponse response) throws HstComponentException { super.doBeforeServeResource(request, response); request.setAttribute(LIFECYCLE_PHASE_ATTRIBUTE, BEFORE_RESOURCE_PHASE); String dispatchPath = getDispatchPathParameter(request, request.getLifecyclePhase()); if (dispatchPath != null) { response.setServeResourcePath(dispatchPath); } try { doDispatch(getDispatchPathParameter(request, BEFORE_RESOURCE_PHASE), request, response); } finally { request.removeAttribute(LIFECYCLE_PHASE_ATTRIBUTE); } }
@Override public void doBeforeRender(HstRequest request, HstResponse response) throws HstComponentException { if(getComponentConfiguration().getRenderPath() == null || "".equals(getComponentConfiguration().getRenderPath())) { // set default builtin template. This is hardcoded. The freemarker templates are relative to the current package name String xtype = getComponentConfiguration().getXType(); if ("HST.UnorderedList".equalsIgnoreCase(xtype)) { response.setRenderPath("classpath:ul.ftl"); } else if ("HST.OrderedList".equalsIgnoreCase(xtype)) { response.setRenderPath("classpath:ol.ftl"); } else if ("HST.Span".equalsIgnoreCase(xtype)) { response.setRenderPath("classpath:span.ftl"); } else if ("HST.vBox".equalsIgnoreCase(xtype)) { response.setRenderPath("classpath:vbox.ftl"); } else if ("HST.NoMarkup".equalsIgnoreCase(xtype)) { response.setRenderPath("classpath:nomarkup.ftl"); } else { response.setRenderPath("classpath:vbox.ftl"); } } super.doBeforeRender(request, response); }
@Override public void destroy() throws HstComponentException { this.delegatedBeanApplicationContext = null; if (delegatedBean != null) { delegatedBean.destroy(); delegatedBean = null; } super.destroy(); }
@Override public void doBeforeServeResource(HstRequest request, HstResponse response) throws HstComponentException { super.doBeforeServeResource(request, response); request.setAttribute(LIFECYCLE_PHASE_ATTRIBUTE, BEFORE_RESOURCE_PHASE); String dispatchPath = getDispatchPathParameter(request, request.getLifecyclePhase()); if (dispatchPath != null) { response.setServeResourcePath(dispatchPath); } try { doDispatch(getDispatchPathParameter(request, BEFORE_RESOURCE_PHASE), request, response); } finally { request.removeAttribute(LIFECYCLE_PHASE_ATTRIBUTE); } }
public void init(ServletContext servletContext, ComponentConfiguration componentConfig) throws HstComponentException { super.init(servletContext, componentConfig); this.servletContext = servletContext; }
public void init(ServletContext servletContext, ComponentConfiguration componentConfig) throws HstComponentException { super.init(servletContext, componentConfig); String param = servletContext.getInitParameter("hst.tracetool.render.path"); if (param != null) { this.renderPath = param; } }
@Override public void init(ServletContext servletContext, ComponentConfiguration componentConfig) throws HstComponentException { super.init(servletContext, componentConfig); String param = servletContext.getInitParameter("hst-spring-delegated-bean-param-name"); if (param != null) { delegatedBeanNameParamName = param; } param = servletContext.getInitParameter("hst-spring-context-name-separator-param-name"); if (param != null) { contextNameSeparator = param; } }
@Override public void init(ServletContext servletContext, ComponentConfiguration componentConfig) throws HstComponentException { super.init(servletContext, componentConfig); this.servletContext = servletContext; String param = servletContext.getInitParameter("hst-spring-delegated-bean-param-name"); if (param != null) { delegatedBeanNameParamName = param; } param = servletContext.getInitParameter("hst-spring-context-name-separator-param-name"); if (param != null) { contextNameSeparator = param; } }
public void init(ServletContext servletContext, ComponentConfiguration componentConfig) throws HstComponentException { super.init(servletContext, componentConfig); if (!this.beansInitialized) { initBeansObjects() ; } }