1 16 17 package org.apache.struts.faces.taglib; 18 19 20 import javax.faces.component.UIComponent; 21 import javax.servlet.jsp.JspException ; 22 import javax.servlet.jsp.PageContext ; 23 import org.apache.struts.Globals; 24 25 26 32 33 public class HtmlTag extends AbstractFacesTag { 34 35 36 38 39 42 private String locale = null; 43 44 public void setLocale(String locale) { 45 this.locale = locale; 46 } 47 48 49 52 private String xhtml = null; 53 54 public void setXhtml(String xhtml) { 55 this.xhtml = xhtml; 56 } 57 58 59 61 62 65 public String getComponentType() { 66 67 return ("org.apache.struts.faces.Html"); 68 69 } 70 71 72 76 public int doStartTag() throws JspException { 77 78 int result = super.doStartTag(); 79 if (xhtml != null) { 80 pageContext.setAttribute(Globals.XHTML_KEY, "true", 81 PageContext.PAGE_SCOPE); 82 } 83 return (result); 84 85 } 86 87 88 92 public String getRendererType() { 93 94 return ("org.apache.struts.faces.Html"); 95 96 } 97 98 99 102 public void release() { 103 104 super.release(); 105 this.locale = null; 106 this.xhtml = null; 107 108 } 109 110 111 113 114 119 protected void setProperties(UIComponent component) { 120 121 super.setProperties(component); 122 setBooleanAttribute(component, "locale", locale); 123 setBooleanAttribute(component, "xhtml", xhtml); 124 125 } 126 127 128 } 129 | Popular Tags |