1 16 package org.apache.myfaces.taglib.core; 17 18 import org.apache.myfaces.renderkit.JSFAttr; 19 import org.apache.myfaces.taglib.UIComponentBodyTagBase; 20 21 import javax.faces.component.UIComponent; 22 import javax.faces.component.UIOutput; 23 import javax.servlet.jsp.JspException ; 24 import javax.servlet.jsp.tagext.BodyContent ; 25 26 30 public class VerbatimTag 31 extends UIComponentBodyTagBase 32 { 33 35 public String getComponentType() 36 { 37 return "javax.faces.Output"; 38 } 39 40 public String getRendererType() 41 { 42 return "javax.faces.Text"; 43 } 44 45 private String _escape; 47 48 protected void setProperties(UIComponent component) 49 { 50 super.setProperties(component); 51 if (_escape != null) 52 { 53 setBooleanProperty(component, JSFAttr.ESCAPE_ATTR, _escape); 54 } 55 else 56 { 57 component.getAttributes().put(JSFAttr.ESCAPE_ATTR, Boolean.FALSE); 60 } 61 62 component.setTransient(true); 64 } 65 66 public void setEscape(String escape) 67 { 68 _escape = escape; 69 } 70 71 public int doAfterBody() throws JspException 72 { 73 BodyContent bodyContent = getBodyContent(); 74 if (bodyContent != null) 75 { 76 UIOutput component = (UIOutput)getComponentInstance(); 77 component.setValue(bodyContent.getString()); 78 } 79 return super.doAfterBody(); 80 } 81 } 82 | Popular Tags |