dgraham 2003/07/09 21:10:05 Modified: src/share/org/apache/struts/taglib/html HtmlTag.java Log: Refactored <html> element generation into new renderHtmlStartElement() method. Revision Changes Path 1.13 +20 -10 jakarta-struts/src/share/org/apache/struts/taglib/html/HtmlTag.java Index: HtmlTag.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/HtmlTag.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- HtmlTag.java 2 Jul 2003 03:52:01 -0000 1.12 +++ HtmlTag.java 10 Jul 2003 04:10:05 -0000 1.13 @@ -132,6 +132,17 @@ * @exception JspException if a JSP exception has occurred */ public int doStartTag() throws JspException { + + ResponseUtils.write(this.pageContext, this.renderHtmlStartElement()); + + return EVAL_BODY_INCLUDE; + } + + /** + * Renders an <html> element with appropriate language attributes. + * @since Struts 1.2 + */ + protected String renderHtmlStartElement() { StringBuffer sb = new StringBuffer("<html"); // Use the current Locale to set our language preferences @@ -142,7 +153,10 @@ boolean validLanguage = ((lang != null) && (lang.length() > 0)); if (this.xhtml) { - this.pageContext.setAttribute(Globals.XHTML_KEY, "true", PageContext.PAGE_SCOPE); + this.pageContext.setAttribute( + Globals.XHTML_KEY, + "true", + PageContext.PAGE_SCOPE); sb.append(" xmlns=\"http://www.w3.org/1999/xhtml\""); } @@ -160,11 +174,7 @@ 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); + return sb.toString(); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]