Refine search
@Override public void doTag() throws JspException { PageContext pageContext = (PageContext) getJspContext(); HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String scopeValue = scope != null ? scope.toLowerCase() : SCOPE_PAGE; if (scopeValue.equals(SCOPE_APPLICATION)) { request.getServletContext().removeAttribute(name); } else if (scopeValue.equals(SCOPE_SESSION)) { request.getSession().removeAttribute(name); } else if (scopeValue.equals(SCOPE_REQUEST)) { request.removeAttribute(name); } else if (scopeValue.equals(SCOPE_PAGE)) { pageContext.removeAttribute(name); } else { throw new JspException("Invalid scope: " + scope); } } }
@Override public int doEndTag() throws JspException { String url = createUrl(); RequestDataValueProcessor processor = getRequestContext().getRequestDataValueProcessor(); ServletRequest request = this.pageContext.getRequest(); if ((processor != null) && (request instanceof HttpServletRequest)) { url = processor.processUrl((HttpServletRequest) request, url); } if (this.var == null) { // print the url to the writer try { this.pageContext.getOut().print(url); } catch (IOException ex) { throw new JspException(ex); } } else { // store the url as a variable this.pageContext.setAttribute(this.var, url, this.scope); } return EVAL_PAGE; }
@Override public int doEndTag() throws JspException { EvaluationContext evaluationContext = (EvaluationContext) this.pageContext.getAttribute(EVALUATION_CONTEXT_PAGE_ATTRIBUTE); if (evaluationContext == null) { evaluationContext = createEvaluationContext(this.pageContext); this.pageContext.setAttribute(EVALUATION_CONTEXT_PAGE_ATTRIBUTE, evaluationContext); } if (this.var != null) { Object result = (this.expression != null ? this.expression.getValue(evaluationContext) : null); this.pageContext.setAttribute(this.var, result, this.scope); } else { try { String result = (this.expression != null ? this.expression.getValue(evaluationContext, String.class) : null); result = ObjectUtils.getDisplayString(result); result = htmlEscape(result); result = (this.javaScriptEscape ? JavaScriptUtils.javaScriptEscape(result) : result); this.pageContext.getOut().print(result); } catch (IOException ex) { throw new JspException(ex); } } return EVAL_PAGE; }
throw new JspException("TransformTag can only be used within EditorAwareTag (e.g. BindTag)"); try { this.pageContext.getOut().print(result); throw new JspException(ex);
@Override public int doEndTag() throws JspException { String url = createUrl(); RequestDataValueProcessor processor = getRequestContext().getRequestDataValueProcessor(); ServletRequest request = this.pageContext.getRequest(); if ((processor != null) && (request instanceof HttpServletRequest)) { url = processor.processUrl((HttpServletRequest) request, url); } if (this.var == null) { // print the url to the writer try { this.pageContext.getOut().print(url); } catch (IOException ex) { throw new JspException(ex); } } else { // store the url as a variable this.pageContext.setAttribute(this.var, url, this.scope); } return EVAL_PAGE; }
/** Invoked at the start tag boundary; does the work. */ public int doStartTag() throws JspException { if (role == null) { throw new JspException("LoggedInRoleTag requires the role attribute"); } HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); return request.isUserInRole(role) ? EVAL_BODY_INCLUDE : SKIP_BODY; }
@Override public int doEndTag() throws JspException { EvaluationContext evaluationContext = (EvaluationContext) this.pageContext.getAttribute(EVALUATION_CONTEXT_PAGE_ATTRIBUTE); if (evaluationContext == null) { evaluationContext = createEvaluationContext(this.pageContext); this.pageContext.setAttribute(EVALUATION_CONTEXT_PAGE_ATTRIBUTE, evaluationContext); } if (this.var != null) { Object result = (this.expression != null ? this.expression.getValue(evaluationContext) : null); this.pageContext.setAttribute(this.var, result, this.scope); } else { try { String result = (this.expression != null ? this.expression.getValue(evaluationContext, String.class) : null); result = ObjectUtils.getDisplayString(result); result = htmlEscape(result); result = (this.javaScriptEscape ? JavaScriptUtils.javaScriptEscape(result) : result); this.pageContext.getOut().print(result); } catch (IOException ex) { throw new JspException(ex); } } return EVAL_PAGE; }
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); JspWriter out = pageContext.getOut(); throw new JspException(ioe.getMessage());
/** Invoked at the tag start transition; does the work */ public int doStartTag() throws JspException { if (userName == null) { throw new JspException("LoggedInUserTag requires the 'user' attribute"); } HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); return request.getRemoteUser().equals(userName) ? EVAL_BODY_INCLUDE : SKIP_BODY; }
@Override public int doEndTag() throws JspException { try { final ASN1InputStream decoder = new ASN1InputStream(value); ASN1Primitive primitive = decoder.readObject(); while (primitive != null && !(primitive instanceof ASN1Null)) { pageContext.getOut().write(doPrimitive(primitive)); primitive = decoder.readObject(); } } catch (Exception ex) { throw new JspException(ex.getMessage()); } return super.doEndTag(); }
public int doEndTag() throws JspException { HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); throw new JspException("Error, no template (body value) set for the sidebar tag."); JspWriter out = pageContext.getOut(); StringBuilder buf = new StringBuilder(); throw new JspException(e);
@Override public int doStartTag() throws JspException { this.request = (HttpServletRequest) this.pageContext.getRequest(); TableTag parent = (TableTag) findAncestorWithClass(this, TableTag.class); if (parent != null) { return SKIP_BODY; } throw new JspException("The tag 'callback' must be inside the 'table' tag."); }
throw new JspException("TransformTag can only be used within EditorAwareTag (e.g. BindTag)"); try { this.pageContext.getOut().print(result); throw new JspException(ex);
public int doEndTag() throws JspException { HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); throw new JspException("Error, no template (body value) set for the sidebar tag."); throw new JspException("Error, no template (body value) set for the subsidebar tag"); JspWriter out = pageContext.getOut(); StringBuilder buf = new StringBuilder(); throw new JspException(e);
@Override public int doStartTag() throws JspException { try { Class<?> actionClass = Class.forName(this.actionClass); StrutsPortalBackend.chooseSelectedFunctionality((HttpServletRequest) pageContext.getRequest(), actionClass); return SKIP_BODY; } catch (ClassNotFoundException e) { throw new JspException("Cannot find action class", e); } }
root.put("any", new JspContextModel(pageContext, JspContextModel.ANY_SCOPE)); template.process(root, pageContext.getOut()); } catch (Exception e) { try { pageContext.handlePageException(e); } catch (ServletException e2) { throw new JspException(e2.getMessage()); } catch (IOException e2) { throw new JspException(e2.getMessage());
@Override public int doStartTag() throws JspException { StringBuilder query = new StringBuilder(); query.append(param).append("=").append(value); for (String name : Collections.list(pageContext.getRequest().getParameterNames())) { if (!param.equals(name)) { query.append("&").append(StringEscapeUtils.escapeHtml4(name)).append("=") .append(StringEscapeUtils.escapeHtml4( ServletRequestUtils.getStringParameter(pageContext.getRequest(), name, ""))); } } try { pageContext.getOut().print(query); } catch (IOException e) { logger.debug("Exception printing query string to JspWriter", e); throw new JspException(e); } return EVAL_BODY_INCLUDE; }
@Override public int doStartTag() throws JspException { this.request = (HttpServletRequest) this.pageContext.getRequest(); TableTag parent = (TableTag) findAncestorWithClass(this, TableTag.class); if (parent != null) { return SKIP_BODY; } throw new JspException("The tag 'callback' must be inside the 'table' tag."); }
@Override public int doStartTag() throws JspException { String title = Long.toString(value); String newValue = SizeExpression.format(value, fractions, true); try { pageContext.getOut().write("<span title=\"" + title + "\">" + newValue + "</span>"); } catch (IOException e) { logger.debug("Exception writing value to JspWriter", e); throw new JspException(e); } return EVAL_BODY_INCLUDE; }
@Override public int doStartTag() throws JspException { boolean getSize = ServletRequestUtils.getBooleanParameter(pageContext.getRequest(), param, false); StringBuilder query = new StringBuilder(); query.append(param).append("=").append(!getSize); String encoding = pageContext.getResponse().getCharacterEncoding(); for (String name : Collections.list(pageContext.getRequest().getParameterNames())) { if (!param.equals(name)) { try { String value = ServletRequestUtils.getStringParameter(pageContext.getRequest(), name, ""); String encodedValue = URLEncoder.encode(value, encoding); query.append("&").append(name).append("=").append(encodedValue); } catch (UnsupportedEncodingException e) { throw new JspException(e); } } } try { pageContext.getOut().print(query); } catch (IOException e) { logger.debug("Exception printing query string to JspWriter", e); throw new JspException(e); } return EVAL_BODY_INCLUDE; }