public int doEndTag() throws JspTagException { Object bean = CDIBeanLocator.getBeanByNameOrType(getBean()); if (bean != null) { if (bean instanceof UIBeanHandler) { String page = ((UIBeanHandler) bean).getBeanJSP(); if (page == null) log.error("Page for component " + getBean() + " is null."); Object previousComponent = pageContext.getRequest().getAttribute(COMPONENT_ATTR_NAME); try { ((UIBeanHandler) bean).beforeRenderBean(); pageContext.getRequest().setAttribute(COMPONENT_ATTR_NAME, bean); pageContext.include(page); pageContext.getRequest().setAttribute(COMPONENT_ATTR_NAME, previousComponent); ((UIBeanHandler) bean).afterRenderBean(); } catch (Exception e) { throw new JspTagException("Error rendering UI bean '" + getBean() + "'", e); } finally { pageContext.getRequest().setAttribute(COMPONENT_ATTR_NAME, previousComponent); } } else { log.error("Bean " + getBean() + " is not a UIBeanHandler"); } } else { log.error("Bean " + getBean() + " is null."); } return EVAL_PAGE; }
public static ControllerServletHelper lookup() { return (ControllerServletHelper) CDIBeanLocator.getBeanByName("controllerServletHelper"); }
public static CurrentComponentRenderer lookup() { return (CurrentComponentRenderer) CDIBeanLocator.getBeanByName("ccrenderer"); }