Package com.sun.facelets

Examples of com.sun.facelets.Facelet.apply()


       
        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("forEach.xml");
       
        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        FastWriter fw = new FastWriter();
        MockResponseWriter mrw = new MockResponseWriter(fw);
        faces.setResponseWriter(mrw);
        root.encodeAll(faces);
View Full Code Here


    public void testNbsp() throws Exception {
        FaceletFactory ff = FaceletFactory.getInstance();
        Facelet f = ff.getFacelet("nbsp.xml");
        FacesContext faces = FacesContext.getCurrentInstance();
        UIViewRoot root = new UIViewRoot();
        f.apply(faces, root);
       
        PrintWriter pw = new PrintWriter(System.out);
        MockResponseWriter rw = new MockResponseWriter(pw);
        faces.setResponseWriter(rw);
       
View Full Code Here

    Facelet f = ff.getFacelet("selectOne.xml");
    this.servletRequest.getSession().setAttribute("test", new TestBean());
    this.servletRequest.setParameter("testForm:alignment", "10");
    FacesContext faces = FacesContext.getCurrentInstance();
    UIViewRoot root = new UIViewRoot();
    f.apply(faces, root);
    UISelectOne one = (UISelectOne) root.findComponent("testForm:alignment");
    root.processDecodes(faces);
    root.processValidators(faces);
    System.out.println(faces.getMessages().hasNext());
  }
View Full Code Here

        FacesContext faces = FacesContext.getCurrentInstance();
       
        UIViewRoot root = faces.getViewRoot();
       
        this.servletRequest.setAttribute("test", "test2.xml");
        f.apply(faces, root);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = faces.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        faces.setResponseWriter(rw);
View Full Code Here

        System.out.println(fw);
       
        ComponentSupport.removeTransient(root);
       
        this.servletRequest.setAttribute("test", "test3.xml");
        f.apply(faces, root);
       
        fw = new FastWriter();
        rw = faces.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        faces.setResponseWriter(rw);
View Full Code Here

    public void testOutput() throws Exception {
        Facelet f = FaceletFactory.getInstance().getFacelet("s_page.xhtml");
        FacesContext faces = FacesContext.getCurrentInstance();
       
        UIViewRoot root = faces.getViewRoot();
        f.apply(faces, root);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = faces.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        faces.setResponseWriter(rw);
View Full Code Here

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("parent.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        faces.setResponseWriter(mrw);
        root.encodeAll(faces);
View Full Code Here

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("composition-template.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
    }
   
    public void testCompositionTemplateSimple() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();
View Full Code Here

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("composition-template-simple.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
    }
   
    public void testComponent() throws Exception {
        FacesContext faces = FacesContext.getCurrentInstance();
        Map map = new HashMap();
View Full Code Here

        FaceletFactory f = FaceletFactory.getInstance();
        Facelet at = f.getFacelet("component.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);
       
        assertEquals("only one child, the component", 1, root.getChildCount());
        assertNotNull("bound to map", map.get("c"));
    }
   
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.