1 package com.sun.facelets; 2 3 import javax.faces.component.UIViewRoot; 4 import javax.faces.context.FacesContext; 5 6 import com.sun.facelets.mock.MockResponseWriter; 7 import com.sun.facelets.util.FastWriter; 8 9 public class TemplateClientTestCase extends FaceletTestCase { 10 11 public void testClientClient() throws Exception { 12 FaceletFactory ff = FaceletFactory.getInstance(); 13 FacesContext faces = FacesContext.getCurrentInstance(); 14 15 Facelet f = ff.getFacelet("template-client-client.xhtml"); 16 17 this.servletRequest.setAttribute("name", "Mr. Hookom"); 18 19 UIViewRoot root = faces.getViewRoot(); 20 f.apply(faces, root); 21 22 FastWriter fw = new FastWriter(); 23 MockResponseWriter mrw = new MockResponseWriter(fw); 24 faces.setResponseWriter(mrw); 25 root.encodeAll(faces); 26 System.out.println(fw); 27 } 28 29 48 49 50 } 51 | Popular Tags |