摘自org.apache.struts.taglib.html.HtmlTag也就是<html:html>对应的那个 /**
* Process the start of this tag.
*
* @exception JspException if a JSP exception has occurred
*/
public int doStartTag() throws JspException {
StringBuffer sb = new StringBuffer("<html"); // Use the current Locale to set our language preferences
Locale currentLocale = this.getCurrentLocale();
String lang = currentLocale.getLanguage(); // Does the locale have a language?
boolean validLanguage = ((lang != null) && (lang.length() > 0)); if (this.xhtml) {
this.pageContext.setAttribute(Globals.XHTML_KEY, "true", PageContext.PAGE_SCOPE);
sb.append(" xmlns=\"http://www.w3.org/1999/xhtml\"");
} if ((this.locale || this.xhtml) && validLanguage) {
sb.append(" lang=\"");
sb.append(lang);
sb.append("\"");
} if (this.xhtml && validLanguage) {
sb.append(" xml:lang=\"");
sb.append(lang);
sb.append("\"");
} sb.append(">"); // Write out the beginning tag for this page
ResponseUtils.write(this.pageContext, sb.toString()); // Evaluate the included content of this tag
return (EVAL_BODY_INCLUDE);
}
* Process the start of this tag.
*
* @exception JspException if a JSP exception has occurred
*/
public int doStartTag() throws JspException {
StringBuffer sb = new StringBuffer("<html"); // Use the current Locale to set our language preferences
Locale currentLocale = this.getCurrentLocale();
String lang = currentLocale.getLanguage(); // Does the locale have a language?
boolean validLanguage = ((lang != null) && (lang.length() > 0)); if (this.xhtml) {
this.pageContext.setAttribute(Globals.XHTML_KEY, "true", PageContext.PAGE_SCOPE);
sb.append(" xmlns=\"http://www.w3.org/1999/xhtml\"");
} if ((this.locale || this.xhtml) && validLanguage) {
sb.append(" lang=\"");
sb.append(lang);
sb.append("\"");
} if (this.xhtml && validLanguage) {
sb.append(" xml:lang=\"");
sb.append(lang);
sb.append("\"");
} sb.append(">"); // Write out the beginning tag for this page
ResponseUtils.write(this.pageContext, sb.toString()); // Evaluate the included content of this tag
return (EVAL_BODY_INCLUDE);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货