@see javax.servlet.jsp.tagext.Tag#doEndTag()

@return EVAL_PAGE

@throws JspException in case something goes wrong
544912
@Override
    public int doEndTag() throws JspException {

        ServletRequest req = pageContext.getRequest();

        // This will always be true if the page is called through OpenCms
        if (CmsFlexController.isCmsRequest(req)) {
            try {
                // Get link-string from the body and reset body
                String link = getBodyContent().getString();
                getBodyContent().clear();
                // Calculate the link substitution
                String newlink = linkTagAction(link, req, getBaseUri(), getDetailPage(), m_locale);
                // Write the result back to the page
                getBodyContent().print(newlink);
                getBodyContent().writeOut(pageContext.getOut());

            } catch (Exception ex) {
                if (LOG.isErrorEnabled()) {
                    LOG.error(Messages.get().getBundle().key(Messages.ERR_PROCESS_TAG_1, "link"), ex);
                }
                throw new JspException(ex);
            }
        }
        return EVAL_PAGE;
    }
834410
@Override
    public int doEndTag() throws JspException {

        if (m_firstOnPage || m_manualPlacement) {
            // only execute action for the first "editable" tag on the page (include file), or in manual mode
            editableTagAction(pageContext, m_provider, m_mode, m_file);
        }
        if (OpenCms.getSystemInfo().getServletContainerSettings().isReleaseTagsAfterEnd()) {
            // need to release manually, JSP container may not call release as required (happens with Tomcat)
            release();
        }

        return EVAL_PAGE;
    }
731553
public int doEndTag() throws JspException
    {
        HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();

        // if we are not handling multipart requests then we can't output the file upload tag and we will
        // report an error
        if (!InternalUtils.isMultipartHandlingEnabled(req)) {
            String s = Bundle.getString("Tags_FileMultiOff", null);
            registerTagError(s, null);
            return EVAL_PAGE;
        }

        // Create the state for the input tag.
        ByRef ref = new ByRef();
        nameHtmlControl(_state, ref);

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

        WriteRenderAppender writer = new WriteRenderAppender(pageContext);
        TagRenderingBase br = TagRenderingBase.Factory.getRendering(TagRenderingBase.INPUT_FILE_TAG, req);
        br.doStartTag(writer, _state);

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

        localRelease();
        return EVAL_PAGE;
    }
496556
public int doStartTag()
            throws JspException
    {
        String scope = getRealIdScope();
        pushIdScope();

        WriteRenderAppender writer = new WriteRenderAppender(pageContext);
        writeBeforeBlocks(writer);

        // if there is a scopeId, then we need to create a div to contains everything
        if (_idScope != null) {
            write("<div");
            write(" netui:idScope=\"");
            write(scope);
            write("\" ");
            write(">");
        }

        return EVAL_BODY_INCLUDE;
    }
610220
@Override
    public int doEndTag() throws JspException {

        // only execute action for the first "ade" tag on the page (include file)
        enableAdeTagAction(pageContext);

        if (OpenCms.getSystemInfo().getServletContainerSettings().isReleaseTagsAfterEnd()) {
            // need to release manually, JSP container may not call release as required (happens with Tomcat)
            release();
        }

        return EVAL_PAGE;
    }
620527
public static Object evaluate(String attributeName,
                                  String expression,
                                  Class expectedType,
                                  Tag tag,
                                  PageContext pageContext)
            throws JspException {

        // delegate the call
        return (EVALUATOR.evaluate(attributeName, expression, expectedType, tag, pageContext));
    }
1329446
@Override
    public int doEndTag() throws JspException {
        String result;                // the eventual result

        // add (already encoded) parameters
        String baseUrl = UrlSupport.resolveUrl(url, context, pageContext);
        result = params.aggregateParams(baseUrl);

        // if the URL is relative, rewrite it with 'redirect' encoding rules
        HttpServletResponse response =
                ((HttpServletResponse) pageContext.getResponse());
        if (!UrlUtil.isAbsoluteUrl(result)) {
            result = response.encodeRedirectURL(result);
        }

        // redirect!
        try {
            response.sendRedirect(result);
        } catch (java.io.IOException ex) {
            throw new JspTagException(ex.toString(), ex);
        }

        return SKIP_PAGE;
    }
371855
public static Object evaluate(String attributeName,
                                  String expression,
                                  Class expectedType,
                                  PageContext pageContext)
            throws JspException {

        return evaluate(attributeName, expression, expectedType, null, pageContext);
    }
1108557
private Object evaluateDataSource()
            throws JspException {
        ExpressionHandling expr = new ExpressionHandling(this);
        String dataSource = getDataSource();
        String ds = expr.ensureValidExpression(dataSource, "dataSource", "DataSourceError");
        if (ds == null)
            return null;

        /* have a valid expression */
        return expr.evaluateExpression(dataSource, "dataSource", pageContext);
    }
321970
@SuppressWarnings("unchecked")
	@Override
	public int doStartTag() throws JspException {
		super.doStartTag();

		if(AssertUtils.isNotEmpty(this.url)) {
			final HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
			Object object = request.getAttribute(JavascriptIncludeTag.JAVASCRIPT_INCLUDE_URL_TAG);
			List<String> urls;
			
			if(object == null) {
				urls = new ArrayList<String>();
				request.setAttribute(JavascriptIncludeTag.JAVASCRIPT_INCLUDE_URL_TAG, urls);
			} else {
				urls = (List<String>) object;
			}
			
			if(this.appendContext) {
				url = UriUtils.addWebPaths(request.getContextPath(), url); 
			}
			
			// do not add a duplicate url here
			if(!urls.contains(url)) {
				urls.add(url);
			}
			
			return SKIP_BODY;
		}
		
		return EVAL_BODY_BUFFERED;
	}
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());
        }
    }
658634
@Override
    public void doTag() throws JspException, IOException {
        LayoutTag layoutTag = (LayoutTag) findAncestorWithClass(this, LayoutTag.class);
        if (layoutTag == null) {
            throw new  IllegalStateException("div tag should be used in a layout tag inside.");
        }

        layoutTag.putDiv(name, TagUtils.toString(getJspBody()));
        logger.debug("div#{} put to layout#{}", name, layoutTag.getName());
    }
78078
@Override
    public void doTag() throws JspException, IOException {
        PageContext         pageContext = (PageContext) getJspContext();
        HttpServletRequest  request     = (HttpServletRequest) pageContext.getRequest();
        HttpServletResponse response    = (HttpServletResponse) pageContext.getResponse();
        HttpSession         session     = request.getSession();


        if (TagUtils.isELValue(getValue())) {
            Object var = TagUtils.getElValue(getJspContext(), TagUtils.getElName(getValue()));
            if (var != null) {
                setValue(var);
            }
        }

        if (StringUtils.equalsIgnoreCase(getScope(), "request")) {
            request.setAttribute(getName(), getValue());
        } else if (StringUtils.equalsIgnoreCase(getScope(), "session")) {
            session.setAttribute(getName(), getValue());
        } else if (StringUtils.equalsIgnoreCase(getScope(), "cookie")) {
            Cookie cookie = new Cookie(getName(), TagUtils.getCookieValue(getValue()));

            // TODO support "Comment" // rfc2019, "Discard" // 2019++, "Expires" // (old cookies), "Secure", "Version"
            if (dynamicAttrMap.containsKey("domain")) {
                cookie.setDomain(ObjectUtils.toString(dynamicAttrMap.get("domain")));
            }
            if (dynamicAttrMap.containsKey("path")) {
                cookie.setPath(ObjectUtils.toString(dynamicAttrMap.get("path")));
            }
            if (dynamicAttrMap.containsKey("maxAge")) {
                int maxAge = NumberUtils.toInt(ObjectUtils.toString(dynamicAttrMap.get("maxAge")), (60*60*24*7)); // default value 1 week(60*60*24*7)
                cookie.setMaxAge(maxAge); //seconds
            }
            response.addCookie(cookie);
        } else {
            throw new IllegalArgumentException(String.format("[%s] is undefined scope value", this.getScope()));
        }
    }
385815
public int doStartTag() throws JspException
    {
        Object val = evaluateDataSource();
        _defaultSelections = (List) evaluateDefaultValue();

        // if there were expression errors report them
        if (hasErrors())
            return SKIP_BODY;

        buildMatch(val);
        if (hasErrors())
            return SKIP_BODY;


        _formatters = new ArrayList();
        _optionList = new ArrayList();

        // Walk the options data source
        _dynamicOptions = evaluateOptionsDataSource();
        if (_repeater) {
            _repCurStage = _order[0];
            boolean valid = doRepeaterAfterBody();
            if (!valid)
                return SKIP_BODY;
            DataAccessProviderStack.addDataAccessProvider(this, pageContext);
        }

        // Continue processing this page
        return EVAL_BODY_BUFFERED;
    }
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();
    }
667662
public int doEndTag() throws JspException
    {
        popIdScope();
        
        // if there are errors then we should output the error table
        ErrorHandling.reportCollectedErrors(pageContext, this);

        // The body tag may cause the scope Div to be closed, if not we must do it now
        //if (getIdScope() != null && !_scopeEnded) {
        //    _writer.append("</div>");
        //}

        // the script can be written out by another tag,  typically this would be the <body> tag.
        writeScript(_writer);

        // close the html tag
        if (!_scopeEnded)
            _writer.append("\n");
        _br.doEndTag(_writer);
        localRelease();
        return EVAL_PAGE;
    }
955936
public static String getAttributeString(Tag tag, String attrName) throws EvaluatorException {
	return getAttributeLiteral(tag, attrName).getString();
    }