@Override public int doEndTag() throws JspException { try { if (pageContext.getRequest().isSecure()) { pageContext.getOut().append("<script src='https://connect.facebook.net/en_US/all.js'></script>"); } else { pageContext.getOut().append("<script src='http://connect.facebook.net/en_US/all.js'></script>"); } pageContext.getOut().append("<div id='fb-root'></div>"); pageContext.getOut().append("<script type='text/javascript'>"); pageContext.getOut().append("FB.init({appId: '" + appId + "', status: true, cookie: true, xfbml: true});"); pageContext.getOut().append("</script>"); } catch (IOException e) { throw new JspException(e); } return EVAL_PAGE; }
@Override public int doEndTag() throws JspException { try { if (pageContext.getRequest().isSecure()) { pageContext.getOut().append("<script src='https://connect.facebook.net/en_US/all.js'></script>"); } else { pageContext.getOut().append("<script src='http://connect.facebook.net/en_US/all.js'></script>"); } pageContext.getOut().append("<div id='fb-root'></div>"); pageContext.getOut().append("<script type='text/javascript'>"); pageContext.getOut().append("FB.init({appId: '" + appId + "', status: true, cookie: true, xfbml: true});"); pageContext.getOut().append("</script>"); } catch (IOException e) { throw new JspException(e); } return EVAL_PAGE; }
/** {@inheritDoc} */ @Override public PrintWriter append(char c) { try { writer.append(c); } catch (IOException e) { log.error("Error when writing in JspWriter", e); setError(); } return this; }
/** {@inheritDoc} */ @Override public PrintWriter append(CharSequence csq) { try { writer.append(csq); } catch (IOException e) { log.error("Error when writing in JspWriter", e); setError(); } return this; }
/** {@inheritDoc} */ @Override public PrintWriter append(CharSequence csq, int start, int end) { try { writer.append(csq, start, end); } catch (IOException e) { log.error("Error when writing in JspWriter", e); setError(); } return this; }
/** {@inheritDoc} */ @Override public PrintWriter append(CharSequence csq) { try { writer.append(csq); } catch (IOException e) { log.error("Error when writing in JspWriter", e); setError(); } return this; }
@Override public int doStartTag() throws JspException { JspWriter out = pageContext.getOut(); String token = (String) pageContext.getRequest().getAttribute(SecurityTokenValidatorImpl.PEBBLE_SECURITY_TOKEN_PARAMETER); if (token != null) { try { if (query) { out.append(SecurityTokenValidatorImpl.PEBBLE_SECURITY_TOKEN_PARAMETER).append("=").append(token); } else { out.append("<input type=\"hidden\" name=\"").append(SecurityTokenValidatorImpl.PEBBLE_SECURITY_TOKEN_PARAMETER); out.append("\" value=\"").append(token).append("\"/>"); } } catch (IOException ioe) { throw new JspException(ioe); } } return SKIP_BODY; }
/** {@inheritDoc} */ @Override public PrintWriter append(char c) { try { writer.append(c); } catch (IOException e) { log.error("Error when writing in JspWriter", e); setError(); } return this; }
/** {@inheritDoc} */ @Override public PrintWriter append(CharSequence csq, int start, int end) { try { writer.append(csq, start, end); } catch (IOException e) { log.error("Error when writing in JspWriter", e); setError(); } return this; }
@Override public Writer append(char c) throws IOException { return getWrapped().append(c); }
@Override public Writer append(char c) throws IOException { return getWrapped().append(c); }
@Override public Writer append(CharSequence csq, int start, int end) throws IOException { return getWrapped().append(csq, start, end); }
@Override public Writer append(CharSequence csq) throws IOException { return getWrapped().append(csq); }
@Override public Writer append(CharSequence csq) throws IOException { return getWrapped().append(csq); }
@Override public Writer append(CharSequence csq, int start, int end) throws IOException { return getWrapped().append(csq, start, end); }
public void decorateFooter(JspWriter out, PageDecoratorContext pageDecoratorContext) throws IOException { Boolean renderFacebookSupport = (Boolean) pageDecoratorContext.getRequest().getAttribute(RENDER_FACEBOOK_SUPPORT_KEY); if (renderFacebookSupport != null && renderFacebookSupport) { // Find out the app ID AbstractBlog abstractBlog = (AbstractBlog) pageDecoratorContext.getRequest().getAttribute(Constants.BLOG_KEY); if (abstractBlog instanceof Blog) { String appId = ((Blog) abstractBlog).getPluginProperties().getProperty(FACEBOOK_APP_ID_KEY); if (appId != null) { out.append("<div id=\"fb-root\"></div>\n" + "<script src=\"http://connect.facebook.net/en_US/all.js\"></script>\n" + "<script>\n" + "FB.init({appId: '").append(appId).append("', status: false, cookie: true, xfbml: true, channelUrl: '") .append(abstractBlog.getUrl()).append("facebook_channel.html'});\n" + "</script>"); } else { // Probably should warn that you need an APP id.... } } } } }
@Override public void doTag() throws JspException, IOException { if (sheep != null) { getJspContext().getOut().write(INJECTION_SUCCESS); } if (initializerCalled) { getJspContext().getOut().append(INITIALIZER_SUCCESS); } } }
@Override public void doTag() throws JspException, IOException { if (sheep != null) { getJspContext().getOut().write(INJECTION_SUCCESS); } if (initializerCalled) { getJspContext().getOut().append(INITIALIZER_SUCCESS); } } }
public void doTag() throws JspException, IOException { JspFragment body = getJspBody(); if (body != null) { StringWriter sw = new StringWriter(); body.invoke(sw); setValue(sw.toString()); } Object ev = JspSupport.getParam((PageContext) getJspContext(), name, value); if (var != null) { getJspContext().setAttribute(var, JspSupport.getParam((PageContext) getJspContext(), name, value)); } else { getJspContext().getOut().append(String.valueOf(ev)); } }
public void doTag() throws JspException, IOException { String err = null; if (JspSupport.hasError((PageContext) getJspContext(), name)) { err = JspSupport.getError((PageContext) getJspContext(), name); if (err == null) { err = defaultText; } } if (var != null) { getJspContext().setAttribute(var, err); } else { if (err != null) { getJspContext().getOut().append(Escape.toSafeHtml(err)); } } }