Package org.rendersnake.internal

Examples of org.rendersnake.internal.HtmlServletCanvas


        }
        Renderable component = this.dispatchMap.get(uri);
        if (component == null) {
            resp.sendError(404);
        } else {
            HtmlServletCanvas canvas = new HtmlServletCanvas(req, resp, resp.getWriter());
            this.copyParametersIntoPageContext(req, canvas);
            canvas.render(component);         
        }
    }
View Full Code Here


            FormResponseAction action = handler.handle(req, resp);
            if (action.redirectToUrl != null) {
                resp.sendRedirect(action.redirectToUrl);
                return;
            } else if (action.component != null){
                HtmlServletCanvas html = new HtmlServletCanvas(req, resp, resp.getWriter());
                this.copyParametersIntoPageContext(req, html);
                action.component.renderOn(html);
            } else {
                resp.setStatus(200);
            }
View Full Code Here

import org.rendersnake.internal.HtmlServletCanvas;

public class HtmlServletCanvasTest extends TestCase {
    public void testCreateWithReqResp() {
        HtmlServletCanvas html = new HtmlServletCanvas(new MockHttpRequest(), new MockHttpResponse(), new StringWriter());
        assertNotNull(html.request);
        assertNotNull(html.response);
        assertNotNull(html.toHtml());
        assertTrue(html.toHtml().length() == 0);
    }
View Full Code Here

        return this;
    }

    private void copyBufferContentsToOutput() {
        try {
            HtmlCanvas outCanvas = new HtmlServletCanvas(request, response, output);
            outCanvas.render(docType);
            outCanvas.html(htmlAttributes);
            // add any head elements
            outCanvas.head(headAttributes);
            if (headElements != null) {
                for (Renderable each : headElements.getRenderables()) {
                    outCanvas.render(each);
                }
            }
            outCanvas._head();
            // copy out contents to output
            outCanvas.out.write(out.toString());
            outCanvas._html();
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }
View Full Code Here

        HtmlCanvas html = null;
        // detect debug request
        if (DEBUG_ENABLED && (request.getParameter(INSPECT_QUERY_PARAM) != null)) {
            html = new DebugHtmlCanvas(request, response, out);
        } else {
            html = new HtmlServletCanvas(request, response, out);
        }
        return html;
    }
View Full Code Here

import org.rendersnake.tools.PrettyWriter;

public class MenuBarTest extends TestCase {
    public void testRender() throws IOException {
        MenuBar mb = new MenuBar("examples.html");
        HtmlCanvas html = new HtmlServletCanvas(null,null,new PrettyWriter());
        html.render(mb);
        System.out.println(html.toHtml());
    }
View Full Code Here

import org.rendersnake.tools.PrettyWriter;

public class SidebarTest extends TestCase {
    public void testRender() throws IOException {
        Sidebar sb = new Sidebar();
        HtmlCanvas html = new HtmlServletCanvas(null,null,new PrettyWriter());
        html.render(sb);
        System.out.println(html.toHtml());
    }
View Full Code Here

import org.rendersnake.tools.PrettyWriter;

public class HeadTest extends TestCase {
    public void testRender() throws IOException {
        Head head = new Head();
        HtmlCanvas html = new HtmlServletCanvas(null,null,new PrettyWriter());
        html.render(head);
        System.out.println(html.toHtml());
    }
View Full Code Here

import org.rendersnake.tools.PrettyWriter;

public class IconImageTest extends TestCase {
    public void testRender() throws IOException {
        IconImage icon = new IconImage("tooltip").alt("happy");
        HtmlCanvas html = new HtmlServletCanvas(null,null,new PrettyWriter());
        html.render(icon);
        System.out.println(html.toHtml());
    }   
View Full Code Here

import org.rendersnake.tools.PrettyWriter;

public class FooterTest extends TestCase {
    public void testRender() throws IOException {
        Footer ui = new Footer();
        HtmlCanvas html = new HtmlServletCanvas(null,null,new PrettyWriter());
        html.render(ui);
        System.out.println(html.toHtml());
    }
View Full Code Here

TOP

Related Classes of org.rendersnake.internal.HtmlServletCanvas

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.