You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by gl...@apache.org on 2005/07/23 05:32:35 UTC
cvs commit: jakarta-tapestry/framework/src/org/apache/tapestry/parse TemplateParser.java
glongman 2005/07/22 20:32:35
Modified: junit/src/org/apache/tapestry/junit/parse Tag: branch-3-0
DuplicateTagAttribute.html TestTemplateParser.java
framework/src/org/apache/tapestry/parse Tag: branch-3-0
TemplateParser.java
Added: junit/src/org/apache/tapestry/junit/parse Tag: branch-3-0
DuplicateTagAttributeII.html
Log:
added check in the unquoted attribute value case. also added another test
PR: TAPESTRY-431
Revision Changes Path
No revision
No revision
1.1.2.2 +1 -1 jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse/Attic/DuplicateTagAttribute.html
Index: DuplicateTagAttribute.html
===================================================================
RCS file: /home/cvs/jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse/Attic/DuplicateTagAttribute.html,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- DuplicateTagAttribute.html 23 Jul 2005 02:42:51 -0000 1.1.2.1
+++ DuplicateTagAttribute.html 23 Jul 2005 03:32:34 -0000 1.1.2.2
@@ -1,6 +1,6 @@
This file tests for a duplicate tag attribute.
-<input jwcid="@TextField" value="ognl:emailAddress" type="text" name="emailaddress" id="emailaddress" size="10" maxlength="25" value="" />
+<input jwcid="@TextField" value="ognl:emailAddress" type="text" name="emailaddress" id="emailaddress" size="10" maxlength="25" value='' />
One possible scenario, designer gives developer a page with a long <input> tag.
Developer adds jwcid and ognl expression for 'value' but misses the fact that
1.14.2.2 +6 -1 jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse/Attic/TestTemplateParser.java
Index: TestTemplateParser.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse/Attic/TestTemplateParser.java,v
retrieving revision 1.14.2.1
retrieving revision 1.14.2.2
diff -u -r1.14.2.1 -r1.14.2.2
--- TestTemplateParser.java 23 Jul 2005 02:42:51 -0000 1.14.2.1
+++ TestTemplateParser.java 23 Jul 2005 03:32:34 -0000 1.14.2.2
@@ -340,6 +340,11 @@
{
runFailure("DuplicateTagAttribute.html", "Tag <input> on line 3 contains more than one 'value' attribute.");
}
+
+ public void testDuplicateTagAttributeFailureII()
+ {
+ runFailure("DuplicateTagAttributeII.html", "Tag <input> on line 3 contains more than one 'value' attribute.");
+ }
public void testUnclosedOpenTagFailure()
{
No revision
Index: TestTemplateParser.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse/Attic/TestTemplateParser.java,v
retrieving revision 1.14.2.1
retrieving revision 1.14.2.2
diff -u -r1.14.2.1 -r1.14.2.2
--- TestTemplateParser.java 23 Jul 2005 02:42:51 -0000 1.14.2.1
+++ TestTemplateParser.java 23 Jul 2005 03:32:34 -0000 1.14.2.2
@@ -340,6 +340,11 @@
{
runFailure("DuplicateTagAttribute.html", "Tag <input> on line 3 contains more than one 'value' attribute.");
}
+
+ public void testDuplicateTagAttributeFailureII()
+ {
+ runFailure("DuplicateTagAttributeII.html", "Tag <input> on line 3 contains more than one 'value' attribute.");
+ }
public void testUnclosedOpenTagFailure()
{
No revision
Index: TestTemplateParser.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse/Attic/TestTemplateParser.java,v
retrieving revision 1.14.2.1
retrieving revision 1.14.2.2
diff -u -r1.14.2.1 -r1.14.2.2
--- TestTemplateParser.java 23 Jul 2005 02:42:51 -0000 1.14.2.1
+++ TestTemplateParser.java 23 Jul 2005 03:32:34 -0000 1.14.2.2
@@ -340,6 +340,11 @@
{
runFailure("DuplicateTagAttribute.html", "Tag <input> on line 3 contains more than one 'value' attribute.");
}
+
+ public void testDuplicateTagAttributeFailureII()
+ {
+ runFailure("DuplicateTagAttributeII.html", "Tag <input> on line 3 contains more than one 'value' attribute.");
+ }
public void testUnclosedOpenTagFailure()
{
1.1.2.1 +15 -0 jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse/Attic/DuplicateTagAttributeII.html
No revision
No revision
1.20.2.2 +14 -2 jakarta-tapestry/framework/src/org/apache/tapestry/parse/Attic/TemplateParser.java
Index: TemplateParser.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/framework/src/org/apache/tapestry/parse/Attic/TemplateParser.java,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -u -r1.20.2.1 -r1.20.2.2
--- TemplateParser.java 23 Jul 2005 02:42:52 -0000 1.20.2.1
+++ TemplateParser.java 23 Jul 2005 03:32:35 -0000 1.20.2.2
@@ -884,8 +884,20 @@
String attributeValue =
new String(_templateData, attributeValueStart, _cursor - attributeValueStart);
- _attributes.put(attributeName, attributeValue);
attributeEndEvent(_cursor);
+
+ if (_attributes.containsKey(attributeName))
+ templateParseProblem(
+ Tapestry.format(
+ "TemplateParser.duplicate-tag-attribute",
+ tagName,
+ Integer.toString(_line),
+ attributeName),
+ getCurrentLocation(),
+ _line,
+ _cursor);
+
+ _attributes.put(attributeName, attributeValue);
state = WAIT_FOR_ATTRIBUTE_NAME;
break;
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org