Package org.rendersnake

Examples of org.rendersnake.HtmlCanvas.render()


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

}
View Full Code Here


public class LoginFormTest extends TestCase {
    public void testRender() throws IOException {
       
        HtmlCanvas html = new HtmlCanvas(new PrettyWriter());
        html.getPageContext().withObject(PageContext.SESSION, new SimpleContextMap());
        html.render(new LoginForm());
       
        System.out.println(html.toHtml());
    }
}
View Full Code Here

    public void render(Map<String, ?> model, HttpServletRequest request, HttpServletResponse response) throws Exception {

        HtmlCanvas html = HtmlCanvasFactory.createCanvas(request, response, response.getWriter());
        HtmlCanvasArgumentResolver.setupPageContext(request, html.getPageContext());
        html.getPageContext().attributes.putAll(model);
        html.render(component);
    }
}
View Full Code Here

            context.withObject(PageContext.REQUEST_PATH, request.getPathTranslated());
            context.withObject(PageContext.REQUEST_URIQ, request.getRequestURI() + (q == null ? "" : "?" + q));
            context.withObject(PageContext.SESSION, new SessionAttributesMap(request));
            context.withObject(PageContext.REQUEST_PARAMETERS, new RequestParametersMap(request))
            context.withObject(PageContext.REQUEST_HEADERS, new RequestHeadersMap(request));
            canvas.render(component);         
        }
    }

    /**
     * Dispatch an incoming request to a PostHandler component
View Full Code Here

    public void testSample() {
        assertNotNull(StringResource.get("content/Sample.html"));
    }
    public void testRenderSample() throws Exception {
        HtmlCanvas html = new HtmlCanvas();
        html.render(new StringResource("content/Sample.html",false));
    }
    public void testTextSample() throws Exception {
        HtmlCanvas html = new HtmlCanvas();
        html.write(StringResource.get("content/Sample.html"),false);
    }
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.