/** * Returns the selected content element String value from the given XML content container, same as * using the <code><cms:contentshow element="***" locale="***" /></code> tag.<p> * * @param container the XML content container to read the content from * @param element the element to show * @param locale the locale to read the element from * * @return the selected content element String value from the given XML content container */ public String contentshow(I_CmsXmlContentContainer container, String element, Locale locale) { return CmsJspTagContentShow.contentShowTagAction(container, getJspContext(), element, locale, false); } }
/** * @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, "contentshow"); String msg = Messages.getLocalizedMessage(errMsgContainer, pageContext); throw new JspTagException(msg); } I_CmsXmlContentContainer contentContainer = (I_CmsXmlContentContainer)ancestor; // now get the content element value to display String content = contentShowTagAction(contentContainer, pageContext, getElement(), m_locale); try { if (content != null) { pageContext.getOut().print(content); } } catch (IOException e) { if (LOG.isErrorEnabled()) { LOG.error(Messages.get().getBundle().key(Messages.LOG_ERR_JSP_BEAN_0), e); } throw new JspException(e); } 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; }
/** * @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, "contentshow"); String msg = Messages.getLocalizedMessage(errMsgContainer, pageContext); throw new JspTagException(msg); } I_CmsXmlContentContainer contentContainer = (I_CmsXmlContentContainer)ancestor; // now get the content element value to display String content = contentShowTagAction(contentContainer, pageContext, getElement(), m_locale, m_escapeHtml); try { if (content != null) { pageContext.getOut().print(content); } } catch (IOException e) { if (LOG.isErrorEnabled()) { LOG.error(Messages.get().getBundle().key(Messages.LOG_ERR_JSP_BEAN_0), e); } throw new JspException(e); } 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; }
/** * Returns the selected content element String value from the given XML content container, same as * using the <code><cms:contentshow element="***" locale="***" /></code> tag.<p> * * @param container the XML content container to read the content from * @param element the element to show * @param locale the locale to read the element from * * @return the selected content element String value from the given XML content container */ public String contentshow(I_CmsXmlContentContainer container, String element, Locale locale) { return CmsJspTagContentShow.contentShowTagAction(container, getJspContext(), element, locale); } }