Package org.rendersnake

Examples of org.rendersnake.HtmlCanvas


      return UNRESOLVED;
   
    HttpServletRequest request = (HttpServletRequest)(webRequest.getNativeRequest());
    HttpServletResponse response = (HttpServletResponse)(webRequest.getNativeResponse());
    response.setContentType("text/html"); // controllers may override this
        final HtmlCanvas canvas = HtmlCanvasFactory.createCanvas(request,response,response.getWriter());       
    setupPageContext(request, canvas.getPageContext());               
    return canvas;
  }
View Full Code Here


        String uri = request.getPathInfo();
        Renderable component = this.dispatchMap.get(uri);
        if (component == null) {
            response.sendError(404);
        } else {
            HtmlCanvas canvas = HtmlCanvasFactory.createCanvas(request,response,response.getWriter());
            PageContext context = canvas.getPageContext();
            String q = request.getQueryString();
            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);         
        }
    }
View Full Code Here

public class HtmlCanvasTest extends TestCase {

    private HtmlCanvas html;

    public void setUp() {
        html = new HtmlCanvas();
    }
View Full Code Here

   


    public void testCreateWithWriter() throws Exception {
        StringWriter out = new StringWriter(1024);
        HtmlCanvas html = new HtmlCanvas(out);
        html.write("hello");
        assertEquals(out.toString(), "hello");
    }
View Full Code Here

public class MacrosTest extends TestCase {
    private HtmlCanvas html;

    public void setUp() {
        html = new HtmlCanvas();
    }
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));
    }
View Full Code Here

    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

    public void testTextSample() throws Exception {
        HtmlCanvas html = new HtmlCanvas();
        html.write(StringResource.get("content/Sample.html"),false);
    }
    public void testTextSampleNoCache() throws Exception {
        HtmlCanvas html = new HtmlCanvas();
        html.write(StringResource.get("content/Sample.html",false),false);
    }   
View Full Code Here

        } catch (IllegalArgumentException ex) {
            // got it
        }
    } 
    public void testRender() throws Exception {
        HtmlCanvas html = new HtmlCanvas();
        ctx.renderForErrorOn(html);
        ctx.renderForInpectorOn(new Inspector(new PersonalPage()), html);
        assertFalse(html.toHtml().length() == 0);
    }
View Full Code Here

TOP

Related Classes of org.rendersnake.HtmlCanvas

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.