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 { 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; }
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); throw new JspException(ioe.getMessage());
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(e);
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"); throw new JspException(e);
@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; }
if (logger.isWarnEnabled()) { logger.warn("it is not in a rose request: '" + ((HttpServletRequest) pageContext.getRequest()).getRequestURI() + "'"); if (logger.isWarnEnabled()) { logger.warn("there is not pipe for this jsp: '" + ((HttpServletRequest) pageContext.getRequest()).getRequestURI() + "'"); throw new JspException(e);
@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; }
/** 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; }
/** 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 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); } }
@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 { 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."); }
public int doEndTag() throws javax.servlet.jsp.JspException { String message = (String) pageContext.getRequest().getAttribute(messageKey); if (message != null) { try { pageContext.getOut().write(message); } catch (IOException e) { throw new javax.servlet.jsp.JspException(e); } } return javax.servlet.jsp.tagext.Tag.EVAL_PAGE; }
@Override public int doEndTag() throws JspException { CsrfToken token = (CsrfToken) this.pageContext.getRequest().getAttribute( CsrfToken.class.getName()); if (token != null) { try { this.pageContext.getOut().write(this.handleToken(token)); } catch (IOException e) { throw new JspException(e); } } return EVAL_PAGE; }
@Override public int doEndTag() throws JspException { CsrfToken token = (CsrfToken) this.pageContext.getRequest().getAttribute( CsrfToken.class.getName()); if (token != null) { try { this.pageContext.getOut().write(this.handleToken(token)); } catch (IOException e) { throw new JspException(e); } } return EVAL_PAGE; }
@Override public int doStartTag() throws JspException { map = new HashMap<String, Object>(); if (StringUtils.isBlank(var)) { // If no var was given, assume that this map should be added to an ancestor list. ListTag listTag = (ListTag) findAncestorWithClass(this, ListTag.class); if (listTag == null) throw new JspException("If no 'var' attribute is given, this Map must have a ListEntry tags ancestor"); listTag.addListEntry(map); } else pageContext.getRequest().setAttribute(var, map); return EVAL_BODY_INCLUDE; }
public int doStartTag() throws JspException { String toDisplay = UIUtil.displayDate(date, displayTime, true, (HttpServletRequest)pageContext.getRequest()); try { pageContext.getOut().print(toDisplay); } catch (IOException ie) { throw new JspException(ie); } return SKIP_BODY; } }
public int doStartTag() throws JspException { PortletResponse portletResponse = (PortletResponse) pageContext.getRequest() .getAttribute(Constants.PORTLET_RESPONSE); String namespace = portletResponse.getNamespace(); JspWriter writer = pageContext.getOut(); try { writer.print(namespace); } catch (IOException ioe) { throw new JspException( "Unable to write namespace", ioe ); } return SKIP_BODY; } }