Return-Path: Delivered-To: apmail-struts-commits-archive@locus.apache.org Received: (qmail 45083 invoked from network); 4 Sep 2007 18:11:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Sep 2007 18:11:44 -0000 Received: (qmail 9989 invoked by uid 500); 4 Sep 2007 18:11:36 -0000 Delivered-To: apmail-struts-commits-archive@struts.apache.org Received: (qmail 9948 invoked by uid 500); 4 Sep 2007 18:11:36 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 9924 invoked by uid 99); 4 Sep 2007 18:11:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2007 11:11:36 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2007 18:11:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A9FAD1A9832; Tue, 4 Sep 2007 11:11:19 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r572764 - in /struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt: Tag.java TagAnnotationProcessor.java Date: Tue, 04 Sep 2007 18:11:19 -0000 To: commits@struts.apache.org From: jholmes@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070904181119.A9FAD1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jholmes Date: Tue Sep 4 11:11:18 2007 New Revision: 572764 URL: http://svn.apache.org/viewvc?rev=572764&view=rev Log: WW-2132 Add support for JSP tag library dynamic attributes Modified: struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/Tag.java struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/TagAnnotationProcessor.java Modified: struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/Tag.java URL: http://svn.apache.org/viewvc/struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/Tag.java?rev=572764&r1=572763&r2=572764&view=diff ============================================================================== --- struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/Tag.java (original) +++ struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/Tag.java Tue Sep 4 11:11:18 2007 @@ -31,6 +31,7 @@ private String tldBodyContent; private String tldTagClass; private String description; + private boolean allowDynamicAttributes; private boolean include = true; private String declaredType; private Map attributes = new TreeMap(); @@ -85,6 +86,14 @@ this.include = include; } + public boolean isAllowDynamicAttributes() { + return allowDynamicAttributes; + } + + public void setAllowDynamicAttributes(boolean allowDynamicAttributes) { + this.allowDynamicAttributes = allowDynamicAttributes; + } + public String getDeclaredType() { return declaredType; } Modified: struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/TagAnnotationProcessor.java URL: http://svn.apache.org/viewvc/struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/TagAnnotationProcessor.java?rev=572764&r1=572763&r2=572764&view=diff ============================================================================== --- struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/TagAnnotationProcessor.java (original) +++ struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/TagAnnotationProcessor.java Tue Sep 4 11:11:18 2007 @@ -114,6 +114,7 @@ tag.setTldBodyContent((String) values.get("tldBodyContent")); tag.setTldTagClass((String) values.get("tldTagClass")); tag.setDeclaredType(typeName); + tag.setAllowDynamicAttributes((Boolean) values.get("allowDynamicAttributes")); // add to map tags.put(typeName, tag); } @@ -318,12 +319,14 @@ // taglib Element tagLib = document.createElement("taglib"); + tagLib.setAttribute("xmlns", "http://java.sun.com/xml/ns/j2ee"); + tagLib.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); + tagLib.setAttribute("xsi:schemaLocation", "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"); + tagLib.setAttribute("version", getOption("jspVersion")); document.appendChild(tagLib); // tag lib attributes appendTextNode(document, tagLib, "tlib-version", getOption("tlibVersion"), false); - appendTextNode(document, tagLib, "jsp-version", - getOption("jspVersion"), false); appendTextNode(document, tagLib, "short-name", getOption("shortName"), false); appendTextNode(document, tagLib, "uri", getOption("uri"), false); @@ -348,10 +351,6 @@ // (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6296446) transformer.setOutputProperty(OutputKeys.INDENT, "yes"); - transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, - "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"); - transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, - "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"); transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); Source source = new DOMSource(document); @@ -397,6 +396,7 @@ createElement(doc, tagElement, attribute); } + appendTextNode(doc, tagElement, "dynamic-attributes", String.valueOf(tag.isAllowDynamicAttributes()), false); } private void createElement(Document doc, Element tagElement,