Package org.rendersnake

Examples of org.rendersnake.HtmlCanvas.render()


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


        Renderable component = resolver.renderComponentForRequest(request);
        if (component == null) {
            component = new MissingComponentError(resolver);  
        }
        try {
            html.render(component);
        } catch (RenderException rex) { 
            LOG.log(Level.SEVERE,"[renderSnake render failure]",rex);
            html.render(rex);
        } catch (Exception ex) {
            LOG.log(Level.SEVERE,"[renderSnake render failure]",ex);
View Full Code Here

        }
        try {
            html.render(component);
        } catch (RenderException rex) { 
            LOG.log(Level.SEVERE,"[renderSnake render failure]",rex);
            html.render(rex);
        } catch (Exception ex) {
            LOG.log(Level.SEVERE,"[renderSnake render failure]",ex);
            html.render(RenderException.caught(ex));
        }
    }
View Full Code Here

        } catch (RenderException rex) { 
            LOG.log(Level.SEVERE,"[renderSnake render failure]",rex);
            html.render(rex);
        } catch (Exception ex) {
            LOG.log(Level.SEVERE,"[renderSnake render failure]",ex);
            html.render(RenderException.caught(ex));
        }
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
View Full Code Here

        try {
            this.safeHandle(request, response);
        } catch (Exception ex) {           
            LOG.log(Level.SEVERE,"[renderSnake form validate|handle failure]",ex);
            final HtmlCanvas html = new HtmlServletCanvas(request, response, response.getWriter());
            html.render(RenderException.caught(ex));
        }
    }

    private void safeHandle(HttpServletRequest request, HttpServletResponse response) throws IOException {
        final FormHandler handler = resolver.formHandlerForRequest(request);
View Full Code Here

public class FancyHeaderTest {
    @Test
    public void test() throws Exception {
       
        HtmlCanvas html = new HtmlCanvas();
        html
            .render(new FancyHeader.Before())
            .write("Hello")
            .render(new FancyHeader.After());
       
        System.out.println(html.toHtml());
View Full Code Here

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

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

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

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

TOP
Copyright © 2018 www.massapi.com. 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.