Package groovy.xml

Examples of groovy.xml.MarkupBuilder


        initialized = true;
        HttpServletResponse response = (HttpServletResponse) super.getVariable("response");
        ServletOutput output = new ServletOutput(response);
        super.setVariable("out", output.getWriter());
        super.setVariable("sout", output.getOutputStream());
        MarkupBuilder builder = new MarkupBuilder(output.getWriter());
        builder.setExpandEmptyElements(true);
        super.setVariable("html", builder);
       
        // bind forward method
        MethodClosure c = new MethodClosure(this, "forward");
        super.setVariable("forward", c);
View Full Code Here


        HttpServletResponse response = (HttpServletResponse) super.getVariable("response");
        ServletContext context = (ServletContext) super.getVariable("context");
        ServletOutput output = new ServletOutput(response);
        super.setVariable("out", output.getWriter());
        super.setVariable("sout", output.getOutputStream());
        super.setVariable("html", new MarkupBuilder(output.getWriter()));
       
        // bind forward method
        MethodClosure c = new MethodClosure(this, "forward");
        super.setVariable("forward", c);
       
View Full Code Here

            if ("sout".equals(name)) {
                return response.getOutputStream();
            }
            if ("html".equals(name)) {
                if (html == null) {
                    html = new MarkupBuilder(response.getWriter());
                }
                return html;
            }
        } catch (IOException e) {
            String message = "Failed to get writer or output stream from response.";
View Full Code Here

            if ("out".equals(name)) {
                return printWriter;
            }
            if ("html".equals(name)) {
                if (html == null) {
                    html = new MarkupBuilder(printWriter);
                }
                return html;
            }
        } catch (Exception e) {
            String message = "Failed to get writer or output stream from response.";
View Full Code Here

  @Override
  public void render(Context context, Markup markup) throws UnsupportedEncodingException {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    OutputStreamWriter writer = new OutputStreamWriter(out, markup.getEncoding());
    MarkupBuilder markupBuilder = new MarkupBuilder(writer);

    ClosureUtil.configureDelegateFirst(markupBuilder, markupBuilder, markup.getDefinition());

    context.getResponse().contentType(markup.getContentType()).send(out.toByteArray());
  }
View Full Code Here

        HttpServletResponse response = (HttpServletResponse) super.getVariable("response");
        ServletOutput output = new ServletOutput(response);
        super.setVariable("out", output.getWriter());
        super.setVariable("sout", output.getOutputStream());

        MarkupBuilder builder = new MarkupBuilder(output.getWriter());
        builder.setExpandEmptyElements(true);
        super.setVariable("html", builder);

        try {
            Class jsonBuilderClass = this.getClass().getClassLoader().loadClass("groovy.json.StreamingJsonBuilder");
            Constructor writerConstructor = jsonBuilderClass.getConstructor(Writer.class);
View Full Code Here

TOP

Related Classes of groovy.xml.MarkupBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.