public int doStartTag() throws JspException { // evaluate any expressions we were passed, once per invocation evaluateExpressions(); // chain to the parent implementation return super.doStartTag(); }
/** * Returns <tt>true</tt> if our current URL is absolute, * <tt>false</tt> otherwise. */ private boolean isAbsoluteUrl() throws JspTagException { return isAbsoluteUrl(url); }
@Override public void release() { urlExpression = null; contextExpression = null; charEncodingExpression = null; super.release(); }
private String acquireString() throws IOException, JspException { if (isAbsoluteUrl) { BufferedReader r = new BufferedReader(acquireReader()); StringBuffer sb = new StringBuffer(); int i; String targetUrl = targetUrl(); if (context != null) c = pageContext.getServletContext().getContext(context); c.getRequestDispatcher(stripSession(targetUrl)); if (rd == null) throw new JspTagException(stripSession(targetUrl)); stripSession(targetUrl));
private Reader acquireReader() throws IOException, JspException { if (!isAbsoluteUrl) { return new StringReader(acquireString()); } else { String target = targetUrl(); try {
public int doStartTag() throws JspException { // Sanity check if (context != null && (!context.startsWith("/") || !url.startsWith("/"))) { throw new JspTagException( Resources.getMessage("IMPORT_BAD_RELATIVE")); } // reset parameter-related state urlWithParams = null; params = new ParamSupport.ParamManager(); // check the URL if (url == null || url.equals("")) throw new NullAttributeException("import", "url"); // Record whether our URL is absolute or relative isAbsoluteUrl = isAbsoluteUrl(); try { // If we need to expose a Reader, we've got to do it right away if (varReader != null) { r = acquireReader(); pageContext.setAttribute(varReader, r); } } catch (IOException ex) { throw new JspTagException(ex.toString(), ex); } return EVAL_BODY_INCLUDE; }
public ImportSupport() { super(); init(); }
public int doEndTag() throws JspException { try { // If we didn't expose a Reader earlier... if (varReader == null) { // ... store it in 'var', if available ... if (var != null) pageContext.setAttribute(var, acquireString(), scope); // ... or simply output it, if we have nowhere to expose it else pageContext.getOut().print(acquireString()); } return EVAL_PAGE; } catch (IOException ex) { throw new JspTagException(ex.toString(), ex); } }
@Override public int doStartTag() throws JspException { // Sanity check if (context != null && (!context.startsWith("/") || !url.startsWith("/"))) { throw new JspTagException( Resources.getMessage("IMPORT_BAD_RELATIVE")); } // reset parameter-related state urlWithParams = null; params = new ParamSupport.ParamManager(); // check the URL if (url == null || url.equals("")) { throw new NullAttributeException("import", "url"); } // Record whether our URL is absolute or relative isAbsoluteUrl = UrlUtil.isAbsoluteUrl(url); try { // If we need to expose a Reader, we've got to do it right away if (varReader != null) { r = acquireReader(); pageContext.setAttribute(varReader, r); } } catch (IOException ex) { throw new JspTagException(ex.toString(), ex); } return EVAL_BODY_INCLUDE; }
private String acquireString() throws IOException, JspException { if (isAbsoluteUrl) { BufferedReader r = new BufferedReader(acquireReader()); StringBuffer sb = new StringBuffer(); int i; String targetUrl = targetUrl(); if (context != null) c = pageContext.getServletContext().getContext(context); c.getRequestDispatcher(stripSession(targetUrl)); if (rd == null) throw new JspTagException(stripSession(targetUrl)); stripSession(targetUrl));
private Reader acquireReader() throws IOException, JspException { if (!isAbsoluteUrl) { return new StringReader(acquireString()); } else { String target = targetUrl(); try {
public int doStartTag() throws JspException { // Sanity check if (context != null && (!context.startsWith("/") || !url.startsWith("/"))) { throw new JspTagException( Resources.getMessage("IMPORT_BAD_RELATIVE")); } // reset parameter-related state urlWithParams = null; params = new ParamSupport.ParamManager(); // check the URL if (url == null || url.equals("")) throw new NullAttributeException("import", "url"); // Record whether our URL is absolute or relative isAbsoluteUrl = isAbsoluteUrl(); try { // If we need to expose a Reader, we've got to do it right away if (varReader != null) { r = acquireReader(); pageContext.setAttribute(varReader, r); } } catch (IOException ex) { throw new JspTagException(ex.toString(), ex); } return EVAL_BODY_INCLUDE; }
public ImportSupport() { super(); init(); }
public int doEndTag() throws JspException { try { // If we didn't expose a Reader earlier... if (varReader == null) { // ... store it in 'var', if available ... if (var != null) pageContext.setAttribute(var, acquireString(), scope); // ... or simply output it, if we have nowhere to expose it else pageContext.getOut().print(acquireString()); } return EVAL_PAGE; } catch (IOException ex) { throw new JspTagException(ex.toString(), ex); } }
@Override public int doStartTag() throws JspException { // Sanity check if (context != null && (!context.startsWith("/") || !url.startsWith("/"))) { throw new JspTagException( Resources.getMessage("IMPORT_BAD_RELATIVE")); } // reset parameter-related state urlWithParams = null; params = new ParamSupport.ParamManager(); // check the URL if (url == null || url.equals("")) { throw new NullAttributeException("import", "url"); } // Record whether our URL is absolute or relative isAbsoluteUrl = UrlUtil.isAbsoluteUrl(url); try { // If we need to expose a Reader, we've got to do it right away if (varReader != null) { r = acquireReader(); pageContext.setAttribute(varReader, r); } } catch (IOException ex) { throw new JspTagException(ex.toString(), ex); } return EVAL_BODY_INCLUDE; }
private String acquireString() throws IOException, JspException { if (isAbsoluteUrl) { BufferedReader r = new BufferedReader(acquireReader()); StringBuffer sb = new StringBuffer(); int i; String targetUrl = targetUrl(); if (context != null) c = pageContext.getServletContext().getContext(context); c.getRequestDispatcher(stripSession(targetUrl)); if (rd == null) throw new JspTagException(stripSession(targetUrl)); stripSession(targetUrl));
/** * Returns <tt>true</tt> if our current URL is absolute, * <tt>false</tt> otherwise. */ private boolean isAbsoluteUrl() throws JspTagException { return isAbsoluteUrl(url); }
private Reader acquireReader() throws IOException, JspException { if (!isAbsoluteUrl) { return new StringReader(acquireString()); } else { String target = targetUrl(); try {
public int doStartTag() throws JspException { // Sanity check if (context != null && (!context.startsWith("/") || !url.startsWith("/"))) { throw new JspTagException( Resources.getMessage("IMPORT_BAD_RELATIVE")); } // reset parameter-related state urlWithParams = null; params = new ParamSupport.ParamManager(); // check the URL if (url == null || url.equals("")) throw new NullAttributeException("import", "url"); // Record whether our URL is absolute or relative isAbsoluteUrl = isAbsoluteUrl(); try { // If we need to expose a Reader, we've got to do it right away if (varReader != null) { r = acquireReader(); pageContext.setAttribute(varReader, r); } } catch (IOException ex) { throw new JspTagException(ex.toString(), ex); } return EVAL_BODY_INCLUDE; }
public ImportSupport() { super(); init(); }