/** * <p>Create a new instance of this <code>ResponseWriter</code> using * a different <code>Writer</code>. * * @param writer The <code>Writer</code> that will be used to create * another <code>ResponseWriter</code>. */ public ResponseWriter cloneWithWriter(Writer writer) { try { return new HtmlResponseWriter(writer, getContentType(), getCharacterEncoding(), isScriptHidingEnabled, isScriptInAttributeValueEnabled, disableUnicodeEscaping); } catch (FacesException e) { // This should never happen throw new IllegalStateException(); } }
/** * <p>Create a new instance of this <code>ResponseWriter</code> using * a different <code>Writer</code>. * * @param writer The <code>Writer</code> that will be used to create * another <code>ResponseWriter</code>. */ public ResponseWriter cloneWithWriter(Writer writer) { try { HtmlResponseWriter responseWriter = new HtmlResponseWriter(writer, getContentType(), getCharacterEncoding(), isScriptHidingEnabled, isScriptInAttributeValueEnabled, disableUnicodeEscaping, isPartial); responseWriter.dontEscape = this.dontEscape; responseWriter.writingCdata = this.writingCdata; return responseWriter; } catch (FacesException e) { // This should never happen throw new IllegalStateException(); } }
/** * <p>Create a new instance of this <code>ResponseWriter</code> using * a different <code>Writer</code>. * * @param writer The <code>Writer</code> that will be used to create * another <code>ResponseWriter</code>. */ @Override public ResponseWriter cloneWithWriter(Writer writer) { try { HtmlResponseWriter responseWriter = new HtmlResponseWriter(writer, getContentType(), getCharacterEncoding(), isScriptHidingEnabled, isScriptInAttributeValueEnabled, disableUnicodeEscaping, isPartial); responseWriter.dontEscape = this.dontEscape; responseWriter.writingCdata = this.writingCdata; return responseWriter; } catch (FacesException e) { // This should never happen throw new IllegalStateException(); } }
/** * <p>Create a new instance of this <code>ResponseWriter</code> using * a different <code>Writer</code>. * * @param writer The <code>Writer</code> that will be used to create * another <code>ResponseWriter</code>. */ @Override public ResponseWriter cloneWithWriter(Writer writer) { try { HtmlResponseWriter responseWriter = new HtmlResponseWriter(writer, getContentType(), getCharacterEncoding(), isScriptHidingEnabled, isScriptInAttributeValueEnabled, disableUnicodeEscaping, isPartial); responseWriter.dontEscape = this.dontEscape; responseWriter.writingCdata = this.writingCdata; return responseWriter; } catch (FacesException e) { // This should never happen throw new IllegalStateException(); } }
/** * <p>Create a new instance of this <code>ResponseWriter</code> using * a different <code>Writer</code>. * * @param writer The <code>Writer</code> that will be used to create * another <code>ResponseWriter</code>. */ @Override public ResponseWriter cloneWithWriter(Writer writer) { try { HtmlResponseWriter responseWriter = new HtmlResponseWriter(writer, getContentType(), getCharacterEncoding(), isScriptHidingEnabled, isScriptInAttributeValueEnabled, disableUnicodeEscaping, isPartial); responseWriter.dontEscape = this.dontEscape; responseWriter.writingCdata = this.writingCdata; return responseWriter; } catch (FacesException e) { // This should never happen throw new IllegalStateException(); } }
public String createHtml(UIComponent component) { FacesContext context = FacesContext.getCurrentInstance(); ResponseWriter oldWriter = context.getResponseWriter(); try { StringWriter buffer = new StringWriter(); context.setResponseWriter(new HtmlResponseWriter(buffer, "text/html", "UTF-8")); component.encodeAll(context); context.getResponseWriter().close(); return buffer.toString(); } finally { context.setResponseWriter(oldWriter); } }
public String createHtml(UIComponent component) { FacesContext context = FacesContext.getCurrentInstance(); ResponseWriter oldWriter = context.getResponseWriter(); try { StringWriter buffer = new StringWriter(); context.setResponseWriter(new HtmlResponseWriter(buffer, "text/html", "UTF-8")); final VisitContext vc = VisitContext.createVisitContext(context, Collections.singleton(component.getClientId()), Collections.<VisitHint> emptySet()); context.getViewRoot().visitTree(vc, new VisitCallback() { public VisitResult visit(final VisitContext ctx, final UIComponent comp) { try { comp.encodeAll(ctx.getFacesContext()); } catch (final IOException e) { throw new IllegalStateException(e); } return VisitResult.COMPLETE; } }); context.getResponseWriter().close(); return buffer.toString(); } finally { context.setResponseWriter(oldWriter); } }
WebConfiguration.DisableUnicodeEscaping.getByValue( webConfig.getOptionValue(DisableUnicodeEscaping)); return new HtmlResponseWriter(writer, contentType, characterEncoding,
WebConfiguration.DisableUnicodeEscaping.getByValue( webConfig.getOptionValue(DisableUnicodeEscaping)); return new HtmlResponseWriter(writer, contentType, characterEncoding,
webConfig.getOptionValue(DisableUnicodeEscaping)); boolean isPartial = context.getPartialViewContext().isPartialRequest(); return new HtmlResponseWriter(writer, contentType, characterEncoding,
WebConfiguration.DisableUnicodeEscaping.getByValue( webConfig.getOptionValue(DisableUnicodeEscaping)); return new HtmlResponseWriter(writer, contentType, characterEncoding,
webConfig.getOptionValue(DisableUnicodeEscaping)); boolean isPartial = context.getPartialViewContext().isPartialRequest(); return new HtmlResponseWriter(writer, contentType, characterEncoding,