Return-Path: Delivered-To: apmail-jakarta-struts-dev-archive@apache.org Received: (qmail 26040 invoked from network); 12 Nov 2001 22:13:19 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 Nov 2001 22:13:19 -0000 Received: (qmail 7459 invoked by uid 97); 12 Nov 2001 22:13:11 -0000 Delivered-To: qmlist-jakarta-archive-struts-dev@jakarta.apache.org Received: (qmail 7407 invoked by uid 97); 12 Nov 2001 22:13:09 -0000 Mailing-List: contact struts-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list struts-dev@jakarta.apache.org Received: (qmail 7365 invoked from network); 12 Nov 2001 22:13:08 -0000 From: "Deadman, Hal" Reply-To: "Deadman, Hal" To: 'Struts Developers List' Subject: RE: Converting struts-html tags to be XHTML-compliant Date: Mon, 12 Nov 2001 17:15:12 -0500 Message-ID: <001801c16bc7$800c53c0$371214ac@bdshdeadman> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I would think request scope would be better than pageContext so the attribute will be available inside jsp:include or template/component includes. -----Original Message----- From: Matt Raible [mailto:matt@raibledesigns.com] Sent: Monday, November 12, 2001 12:01 AM To: struts-dev@jakarta.apache.org Subject: Converting struts-html tags to be XHTML-compliant I am taking on the project of converting (with backwards compatibility) all the struts-html tags to be XHTML-compliant. I'd like to use this e-mail to tell you my approach, ask you for advice, and get your feedback. 1. Approach: In HtmlTag.java, add if (xhtml) pageContext.setAttribute("xhtml", "true"); In all other html-producing tags (i.e. img, input), do a check when closing the tag: // check if this is an XHTML document String xhtml = (String) pageContext.getAttribute("xhtml"); if (xhtml != null && xhtml.equals("true")) { results.append("\" />"); // extra space before close will allow XHTML to work in older browsers } else { results.append("\">"); } 2. Advice: Should I be setting the "xhtml" variable in the pageContext, request, or session. Page seems to make the most sense since that is what this variable relates to. However, to do this (to my understanding), I have to create HtmlTei.java and add the declaration to the struts-html.tld: public class HtmlTei extends TagExtraInfo { /** * Return information about the scripting variables to be created. */ public VariableInfo[] getVariableInfo(TagData data) { return new VariableInfo[] { new VariableInfo(data.getAttributeString("xhtml"), "java.lang.String", true, VariableInfo.NESTED) }; } } However, this does not work as I'd expect it to. What I'm expecting is that I am exposing the "xhtml" variable simply by adding the HtmlTei class - but it's not working at all. 3. Feedback: Please let me know what you think of this approach. By doing this, and adding a check if the user wants the doc to be XHTML, we should achieve full backwards compatibility, and be able to convert the struts-html tags to be XHTML-compliant. Thanks, Matt -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: