Render the checkbox.
@throws JspException if a JSP exception has occurred
163056
public int doEndTag() throws JspException
    {
        Tag parent = getParent();
        if (parent instanceof CheckBoxGroup)
            registerTagError(Bundle.getString("Tags_CheckBoxGroupChildError"), null);

        Object val = evaluateDataSource();
        if (hasErrors())
            return reportAndExit(EVAL_PAGE);

        ByRef ref = new ByRef();
        nameHtmlControl(_state, ref);

        String hiddenParamName = _state.name + OLDVALUE_SUFFIX;
        ServletRequest req = pageContext.getRequest();

        if (val instanceof String) {
            if (val != null && Boolean.valueOf(val.toString()).booleanValue())
                _state.checked = true;
            else
                _state.checked = false;
        }
        else if (val instanceof Boolean) {
            _state.checked = ((Boolean) val).booleanValue();
        }
        else {
            String oldCheckBoxValue = req.getParameter(hiddenParamName);
            if (oldCheckBoxValue != null) {
                _state.checked = new Boolean(oldCheckBoxValue).booleanValue();
            }
            else {
                _state.checked = evaluateDefaultValue();
            }
        }
        _state.disabled = isDisabled();

        //Create a hidden field to store the CheckBox oldValue
        String oldValue = req.getParameter(_state.name);
        WriteRenderAppender writer = new WriteRenderAppender(pageContext);

        // if the checkbox is disabled we need to not write out the hidden
        // field because it can cause the default state to change from
        // true to false.  Disabled check boxes do not postback.
        if (!_state.disabled) {
            _hiddenState.name = hiddenParamName;
            if (oldValue == null) {
                _hiddenState.value = "false";
            }
            else {
                _hiddenState.value = oldValue;
            }
            TagRenderingBase hiddenTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_HIDDEN_TAG, req);
            hiddenTag.doStartTag(writer, _hiddenState);
            hiddenTag.doEndTag(writer);
        }

        _state.type = INPUT_CHECKBOX;

        TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_BOOLEAN_TAG, req);
        br.doStartTag(writer, _state);

        if (!ref.isNull())
            write((String) ref.getRef());

        // Continue processing this page
        localRelease();
        return EVAL_PAGE;
    }
653206
protected void renderInputTag(FacesContext context, ResponseWriter rw, String clientId,
			SelectBooleanCheckbox selectBooleanCheckbox) throws IOException {
		int numberOfDivs = 0;
		String responsiveStyleClass = Responsive.getResponsiveStyleClass(selectBooleanCheckbox, false).trim();
		if (responsiveStyleClass.length() > 0 && isHorizontalForm(selectBooleanCheckbox)) {
			rw.startElement("div", selectBooleanCheckbox);
			rw.writeAttribute("class", responsiveStyleClass, "class");
			numberOfDivs++;
		}
		
		renderInputTag(rw, context, selectBooleanCheckbox, clientId);
		renderInputTagAttributes(rw, clientId, selectBooleanCheckbox);
		// Render Ajax Capabilities
		AJAXRenderer.generateBootsFacesAJAXAndJavaScript(FacesContext.getCurrentInstance(), selectBooleanCheckbox, rw, false);

		renderInputTagValue(context, rw, selectBooleanCheckbox);
		renderInputTagEnd(rw, selectBooleanCheckbox);
		renderInputTagHelper(rw, context, selectBooleanCheckbox, clientId);
		
		while (numberOfDivs > 0) {
			rw.endElement("div"); 
			numberOfDivs--;
		}
	}
446039
public int doEndTag() throws JspException
    {
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
        HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
        ServletContext context = pageContext.getServletContext();

        try {
            boolean encoded = false;
            UrlConfig urlConfig = ConfigUtil.getConfig().getUrlConfig();
            if (urlConfig != null) {
                encoded = !urlConfig.isUrlEncodeUrls();
            }

            FreezableMutableURI uri = new FreezableMutableURI();
            uri.setEncoding(response.getCharacterEncoding());
            uri.setURI(url, encoded);
            boolean needsToBeSecure = false;
            if (_params != null) {
                uri.addParameters(_params, false );
            }
            if (!uri.isAbsolute() && PageFlowUtils.needsToBeSecure(context, request, url, true)) {
                needsToBeSecure = true;
            }

            URLRewriterService.rewriteURL(context, request, response, uri, URLType.ACTION, needsToBeSecure);
            String key = PageFlowUtils.getURLTemplateKey(URLType.ACTION, needsToBeSecure);
            boolean forXML = TagRenderingBase.Factory.isXHTML(request);
            URIContext uriContext = URIContextFactory.getInstance(forXML);
            String uriString = URLRewriterService.getTemplatedURL(context, request, uri, key, uriContext);
            write(response.encodeURL(uriString));
        }
        catch (URISyntaxException e) {
            // report the error...
            String s = Bundle.getString("Tags_RewriteURL_URLException",
                    new Object[]{url, e.getMessage()});
            registerTagError(s, e);
            reportErrors();
        }

        localRelease();
        return EVAL_PAGE;
    }
104601
public void printHtmlStartForm(PrintWriter out)
        throws DBException
    {
        String strAction = "post";

        BasePanel modelScreen = (BaseScreen)this.getScreenField();
        int iNumCols = modelScreen.getSFieldCount();
        int iInputCount = 0;
        for (int i = 0; i < iNumCols; i++)
        {
            ScreenField sField = modelScreen.getSField(i);
            if (!sField.isToolbar())
                if (sField.getConverter() != null)
                    if (sField.getConverter().getField() != null)
                    {
                        if (DBParams.PASSWORD.equalsIgnoreCase(sField.getConverter().getField().getFieldName()))
                            iInputCount = 5;    // Always post if password is in the URL
                        iInputCount++;
                    }
        }
        if (iInputCount < 5)
            strAction = "get";
        if (modelScreen instanceof GridScreen)
            if (modelScreen.getEditing() == true)
                strAction = "post";
        out.println("<form action=\"" + modelScreen.getServletPath(null) + "\" method=\"" + strAction + "\">");
        this.addHiddenParams(out, this.getHiddenParams());
    }
556524
@Override
    public int doEndTag() throws JspException {

        ServletRequest req = pageContext.getRequest();
        ServletResponse res = pageContext.getResponse();

        if (CmsFlexController.isCmsRequest(req)) {
            // this will always be true if the page is called through OpenCms
            CmsObject cms = CmsFlexController.getCmsObject(req);
            String target = null;

            // try to find out what to do
            if (m_target != null) {
                // option 1: target is set with "page" or "file" parameter
                target = m_target + getSuffix();
            } else if (m_property != null) {
                // option 2: target is set with "property" parameter
                try {
                    String prop = cms.readPropertyObject(cms.getRequestContext().getUri(), m_property, true).getValue();
                    if (prop != null) {
                        target = prop + getSuffix();
                    }
                } catch (RuntimeException e) {
                    // target must be null
                    target = null;
                } catch (Exception e) {
                    // target will be null
                    e = null;
                }
            } else if (m_attribute != null) {
                // option 3: target is set in "attribute" parameter
                try {
                    String attr = (String)req.getAttribute(m_attribute);
                    if (attr != null) {
                        target = attr + getSuffix();
                    }
                } catch (RuntimeException e) {
                    // target must be null
                    target = null;
                } catch (Exception e) {
                    // target will be null
                    e = null;
                }
            } else {
                // option 4: target might be set in body
                String body = null;
                if (getBodyContent() != null) {
                    body = getBodyContent().getString();
                    if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(body)) {
                        // target IS set in body
                        target = body + getSuffix();
                    }
                    // else target is not set at all, default will be used
                }
            }

            // now perform the include action
            includeTagAction(
                pageContext,
                target,
                m_element,
                null,
                m_editable,
                m_cacheable,
                m_parameterMap,
                CmsRequestUtil.getAtrributeMap(req),
                req,
                res);

            release();
        }

        return EVAL_PAGE;
    }
126422
protected void init() throws JspException {

        // initialize OpenCms access objects
        m_controller = CmsFlexController.getController(pageContext.getRequest());
        m_cms = m_controller.getCmsObject();

        try {
            I_CmsSearchConfiguration config = null;
            if (m_configFile != null) {
                CmsFile configFile = m_cms.readFile(CmsJspElFunctions.convertRawResource(m_cms, m_configFile));
                if (m_fileFormat == FileFormat.JSON) {
                    // read the JSON config file
                    OpenCms.getLocaleManager();
                    String configString = new String(
                        configFile.getContents(),
                        CmsLocaleManager.getResourceEncoding(m_cms, configFile));
                    config = new CmsSearchConfiguration(new CmsJSONSearchConfigurationParser(configString));
                } else { // assume XML
                    CmsXmlContent xmlContent = CmsXmlContentFactory.unmarshal(m_cms, configFile);
                    config = new CmsSearchConfiguration(
                        new CmsXMLSearchConfigurationParser(xmlContent, m_cms.getRequestContext().getLocale()));
                }
            }
            if (m_configString != null) {
                if (m_configString.trim().startsWith("{")) {
                    config = new CmsSearchConfiguration(new CmsJSONSearchConfigurationParser(m_configString, config));
                } else {
                    config = new CmsSearchConfiguration(
                        new CmsPlainQuerySearchConfigurationParser(m_configString, config));
                }
            }
            m_searchController = new CmsSearchController(config);

            String indexName = m_searchController.getCommon().getConfig().getSolrIndex();
            // try to use configured index
            if ((indexName != null) && !indexName.trim().isEmpty()) {
                m_index = OpenCms.getSearchManager().getIndexSolr(indexName);
            }
            // if not successful, use the following default
            if (m_index == null) {
                m_index = OpenCms.getSearchManager().getIndexSolr(
                    m_cms.getRequestContext().getCurrentProject().isOnlineProject()
                    ? CmsSolrIndex.DEFAULT_INDEX_NAME_ONLINE
                    : CmsSolrIndex.DEFAULT_INDEX_NAME_OFFLINE);
            }

            storeAttribute(getVar(), getSearchResults());

        } catch (Exception e) { // CmsException | UnsupportedEncodingException | JSONException
            LOG.error(e.getLocalizedMessage(), e);
            m_controller.setThrowable(e, m_cms.getRequestContext().getUri());
            throw new JspException(e);
        }
    }
1006676
@Override
	public void render() {
		if (false == HuluSetting.isDevMode) {
			Response.sendError(this.errorCode, this.errorContent);
			return;
		}

		if (null != e) {
			StaticLog.error(e);
			if (null == this.errorContent) {
				this.errorContent = StrUtil.EMPTY;
			}
			String stacktraceContent = ExceptionUtil.stacktraceToString(e)
					.replace("\tat", "&nbsp;&nbsp;&nbsp;&nbsp;\tat")
					.replace("\n", "<br/>\n");
			this.errorContent = StrUtil.format(TEMPLATE_ERROR, this.getErrorCode(), Request.getServletRequest().getRequestURI(), this.errorContent, stacktraceContent);
		}
		
		Response.setStatus(errorCode);
		Response.write(errorContent, Response.CONTENT_TYPE_HTML);
	}
1089329
public int doEndTag() throws JspException
    {
        ServletRequest req = pageContext.getRequest();

        String fmtErrors = null;
        if (_formatterError) {
            fmtErrors = getErrorsFromBody();
        }
        if (hasErrors())
            return reportAndExit(EVAL_PAGE);

        _state.disabled = isDisabled();

        //Create hidden field for state tracking
        ByRef ref = new ByRef();
        nameHtmlControl(_state, ref);

        if (hasErrors())
            return reportAndExit(EVAL_PAGE);

        // Only write out the hidden field if the select is not
        // disabled.  If it is disabled, then nothing will be posted
        // back from this.
        WriteRenderAppender writer = new WriteRenderAppender(pageContext);
        if (!_state.disabled) {
            _hiddenState.clear();
            String hiddenParamName = null;
            hiddenParamName = _state.name + OLDVALUE_SUFFIX;
            _hiddenState.name = hiddenParamName;
            _hiddenState.value = "true";

            TagRenderingBase hiddenTag = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_HIDDEN_TAG, req);
            hiddenTag.doStartTag(writer, _hiddenState);
            hiddenTag.doEndTag(writer);
            write("\n");
        }

        // Render any formatting errors that may have occurred.
        if (fmtErrors != null)
            write(fmtErrors);


        TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.SELECT_TAG, req);
        br.doStartTag(writer, _state);

        // Render the content of the body, these would be the options
        if (_saveBody != null) {
            write(_saveBody);
        }

        // if we are repeating then the body contained the options so we can exit here
        if (_repeater) {

            if (hasErrors())
                return reportAndExit(EVAL_PAGE);

            br.doEndTag(writer);
            if (!ref.isNull())
                write((String) ref.getRef());

            // Continue processing this page
            localRelease();
            return EVAL_PAGE;
        }

        // All of the code below will pass through the optionsDataSource, the dataSource and defaultValue and
        // create a full Select.
        if (_dynamicOptions != null) {
            if (_dynamicOptions instanceof Map) {
                Map dynamicOptionsMap = (Map) _dynamicOptions;
                Iterator keyIterator = dynamicOptionsMap.keySet().iterator();
                while (keyIterator.hasNext()) {
                    Object optionValue = keyIterator.next();
                    String optionDisplay = null;
                    if (dynamicOptionsMap.get(optionValue) != null) {
                        optionDisplay = dynamicOptionsMap.get(optionValue).toString();
                    }

                    if (optionValue != null) {
                        addOption(req, optionValue.toString(), optionDisplay);
                    }
                }
            }
            else if (_dynamicOptions instanceof Iterator) {
                Iterator dynamicOptionsIterator = (Iterator) evaluateOptionsDataSource();
                while (dynamicOptionsIterator.hasNext()) {
                    Object o = dynamicOptionsIterator.next();
                    if (o != null) {
                        String optionValue = o.toString();
                        addOption(req, optionValue, optionValue);
                    }
                }
            }
        }

        // add the value from the DataSource and Default value
        addDatasourceIfNeeded(req);
        addDefaultsIfNeeded(req);
        if (_nullable && !isMultiple()) {
            String txt = (_nullableOptionText != null) ? _nullableOptionText : "";
            addOption(req, NULL_VALUE, txt);
        }

        br.doEndTag(writer);
        if (!ref.isNull())
            write((String) ref.getRef());

        // Continue processing this page
        localRelease();
        return EVAL_PAGE;
    }
455596
@Override
	public void render() {
		try {
			final HttpServletRequest request = Request.getServletRequest();
			request.getRequestDispatcher(uri).forward(request, Response.getServletResponse());
		} catch (Exception e) {
			throw new RenderException("Forward to " + uri + " error!", e);
		}
	}
1184810
public void doTag()
            throws JspException
    {
        // First look for the exception in the pageflow/struts request attribute.  If it's not there,
        // look for it in the request attribute the container provides for web.xml-configured error
        // pages.
        InternalStringBuilder results = new InternalStringBuilder(128);
        PageContext pageContext = getPageContext();
        Throwable e = (Throwable) pageContext.getAttribute(Globals.EXCEPTION_KEY, PageContext.REQUEST_SCOPE);

        if (e == null) {
            ServletRequest req = pageContext.getRequest();
            e = (Throwable) req.getAttribute("javax.servlet.error.exception");
            if (e == null) {
                e = (Throwable) req.getAttribute("javax.servlet.jsp.jspException");
            }
        }

        if (!_showStackTrace && _showDevModeStackTrace) {
            boolean devMode = !AdapterManager.getServletContainerAdapter(pageContext.getServletContext()).isInProductionMode();
            if (devMode)
                _showStackTrace = true;
        }

        if (e != null) {
            if (_showMessage) {
                String msg = e.getMessage();
                // if we have message lets output the exception name and the name of the
                if ((msg != null) && (msg.length() > 0)) {
                    if (!_showStackTrace)
                        msg = e.getClass().getName() + ": " + msg;
                    results.append(HtmlExceptionFormatter.format(msg, e, _showStackTrace));
                }
                else {
                    results.append(HtmlExceptionFormatter.format(e.getClass().getName(), e, _showStackTrace));
                }
            }
            else {
                results.append(HtmlExceptionFormatter.format(null, e, _showStackTrace));
            }
            ResponseUtils.write(pageContext, results.toString());
        }
    }
1115983
@Override
    protected void renderTagEnd() {
        try {
            if (StringUtils.isNotEmpty(this.output)) {
                this.output = toString(this.escape
                        ? escape(this.output)
                        : this.output);
                JspWriter writer = this.pageContext.getOut();
                boolean renderTag = renderTag()
                        && (StringUtils.isNotBlank(this.tagName) || StringUtils.isNotBlank(getClasses()));
                if (renderTag) {
                    super.renderTagStart();
                }
                writer.write(this.output);
                if (renderTag) {
                    super.renderTagEnd();
                }
            }
        } catch (IOException ioex) {
            LOG.error(ioex.getMessage(), ioex);
        }
    }
654306
public void displayReport() throws JspException {

        // save initialized instance of this class in request attribute for included sub-elements
        getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
        switch (getAction()) {
            case ACTION_REPORT_END:
            case ACTION_CANCEL:
                actionCloseDialog();
                break;
            case ACTION_REPORT_UPDATE:
                setParamAction(REPORT_UPDATE);
                getJsp().include(FILE_REPORT_OUTPUT);
                break;
            case ACTION_REPORT_BEGIN:
            case ACTION_CONFIRMED:
            case ACTION_DEFAULT:
            default:
                I_CmsReportThread thread = initializeThread();
                thread.start();
                setParamAction(REPORT_BEGIN);
                setParamThread(thread.getUUID().toString());
                getJsp().include(FILE_REPORT_OUTPUT);
        }
    }
983498
public function render()
    {
        if ($this->cssIdentifier === null) {
            throw new Exception("All UIControls must set a cssIdentifier property");
        }

        if ($this->jsClass === null) {
            throw new Exception("All UIControls must set a jsClass property");
        }

        return parent::render();
    }
1299099
public void doTag()
            throws JspException
    {
        // report error if there are any
        if (hasErrors()) {
            reportErrors();
            return;
        }

        PageContext pageContext = getPageContext();
        ServletContainerAdapter sa = AdapterManager.getServletContainerAdapter(pageContext.getServletContext());
        ServletRequest request = pageContext.getRequest();
        assert(sa != null);

        // check to see if we are supposed to report the error
        boolean prodMode = sa.isInProductionMode();
        if (prodMode && !_alwaysReport)
            return;

        LinkedHashMap map = (LinkedHashMap)
                InternalUtils.getBindingUpdateErrors(request);

        if (map == null)
            return;

        if (_expression != null) {
            String expr = "{" + _expression + "}";
            BindingUpdateError err = (BindingUpdateError) map.get(expr);
            if (err != null) {
                Throwable cause = err.getCause();
                String msg = (cause != null) ? cause.getMessage() : err.getMessage();
                String s = Bundle.getString("Tags_BindingUpdateError", new Object[]{_expression, msg});
                registerTagError(s, null);
                reportErrors();
            }
            return;
        }

        Iterator it = map.values().iterator();
        while (it.hasNext()) {
            BindingUpdateError err = (BindingUpdateError) it.next();
            Throwable cause = err.getCause();
            String msg = (cause != null) ? cause.getMessage() : err.getMessage();
            String s = Bundle.getString("Tags_BindingUpdateError", new Object[]{err.getExpression(), msg});
            registerTagError(s, null);
        }
        reportErrors();
    }
369690
public void render() {
    try {
      this.response.setHeader("Content-type", "text/html; charset=UTF-8");
      this.response.setCharacterEncoding("UTF-8");
      this.response.setContentType(this.mimeType);
      this.engine.mergeTemplate(this.template, "UTF-8", this.context, this.response.getWriter());
    } catch (final Exception e) {
      throw new PageRenderException(e);
    }
  }
602273
public void displayDialog() throws Exception {

        initAdminTool();

        JspWriter out = getJsp().getJspContext().getOut();
        out.print(htmlStart());
        out.print(bodyStart(null));
        out.print("<form name='editor' method='post' target='_top' action='");
        out.print(getJsp().link("/system/workplace/editors/editor.jsp"));
        out.print("'>\n");
        out.print(paramsAsHidden());
        out.print("</form>\n");
        out.print("<script type='text/javascript'>\n");
        out.print("document.forms['editor'].submit();\n");
        out.print("</script>\n");
        out.print(bodyEnd());
        out.print(htmlEnd());
    }
1214463
@Override
	public void render() {
		if(null == this.in){
			throw new RenderException("InputStream is null !");
		}
		
		Response.setContentType(this.contentType);
		Response.write(this.in, this.bufferSize);
	}