Tag ancestor = findAncestorWithClass(this, I_CmsXmlContentContainer.class); if (ancestor == null) { CmsMessageContainer errMsgContainer = Messages.get().container( storeAttribute(bean); storeAttribute(getVal(), bean.getValue());
/** * @see javax.servlet.jsp.tagext.Tag#doEndTag() */ @Override public int doEndTag() { if (OpenCms.getSystemInfo().getServletContainerSettings().isReleaseTagsAfterEnd()) { // need to release manually, JSP container may not call release as required (happens with Tomcat) release(); } return EVAL_PAGE; }
/** * @see javax.servlet.jsp.tagext.Tag#doStartTag() */ @Override public int doStartTag() throws JspException { // get a reference to the parent "content container" class Tag ancestor = findAncestorWithClass(this, I_CmsXmlContentContainer.class); if (ancestor == null) { CmsMessageContainer errMsgContainer = Messages.get().container( Messages.ERR_PARENTLESS_TAG_1, "contentaccess"); String msg = Messages.getLocalizedMessage(errMsgContainer, pageContext); throw new JspTagException(msg); } // get the currently open content container I_CmsXmlContentContainer contentContainer = (I_CmsXmlContentContainer)ancestor; // get loaded content from content container I_CmsXmlDocument xmlContent = contentContainer.getXmlDocument(); // get the current users OpenCms context CmsObject cms = CmsFlexController.getCmsObject(pageContext.getRequest()); // get the selected Locale or use the default from the OpenCms request context Locale locale = m_locale == null ? cms.getRequestContext().getLocale() : m_locale; // initialize a new instance of a content access bean CmsJspContentAccessBean bean = new CmsJspContentAccessBean(cms, locale, xmlContent); // store the content access bean in the selected page context scope storeAttribute(bean); return SKIP_BODY; }
/** * @see javax.servlet.jsp.tagext.Tag#doEndTag() */ @Override public int doEndTag() { if (OpenCms.getSystemInfo().getServletContainerSettings().isReleaseTagsAfterEnd()) { // need to release manually, JSP container may not call release as required (happens with Tomcat) release(); } return EVAL_PAGE; }