
| Key: |
TAPESTRY-431
|
| Type: |
Bug
|
| Status: |
Resolved
|
| Resolution: |
Duplicate
|
| Priority: |
Minor
|
| Assignee: |
Unassigned
|
| Reporter: |
Geoff Longman
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
Time Tracking:
Issue & Sub-Tasks
Issue Only
Issue & Sub-Tasks
Issue Only
|
|
|
|
Issue Links:
|
Duplicate
|
|
This issue duplicates:
|
|
TAPESTRY-432
Change TemplateParser to throw an exception and stop parsing when duplicate attributes are found in a tag
|
|
|
|
|
|
|
|
| Resolution Date: |
24/Aug/05 07:41 AM
|
|
No sub-tasks match this view.
|
|
|
|
This shows an example.
<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
there is already a 'value' attribute. Unless this case was handled as an error, the TemplateParser
will silently throw away the first 'value' attribute and bind the parameter statically.
This hurts in, say, a TextField as Tapestry dumps an exception page when it tries to update
value's binding since static bindings do not allow this.
Tough to track down as, in this case, the stack trace shows that AbstractBinding.setString()
throwing the exception. My experience with coworkers this week is that encountering this issue is painful unless you are well familliar with the mechanics of bindings.
In other words, this *kills* newbies!
I have built a fix, yet to be checked in. All tests still run + I created a new test. I started in the T3 3.0 branch because a) The issue may be fixed in T4 already (have not checked yet) b) Spindle for T3 needs this fix.
The fix will detect the duplicate and build the message, "Tag <{0}> on line {1} contains more than one ''{2}'' attribute."
I think this is an error that should stop the template parse. But, if that is not desired, it could just be a logged event, or both. Pls, nobody suggest that the behaviour be configurable. This is happening at pretty much the lowest level in Tapestry and IMO it should be both an exception and a log entry. Doesn't matter to Spindle as the the mechanism for doing either suite me fine.
comments?
|
|
Description
|
This shows an example.
<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
there is already a 'value' attribute. Unless this case was handled as an error, the TemplateParser
will silently throw away the first 'value' attribute and bind the parameter statically.
This hurts in, say, a TextField as Tapestry dumps an exception page when it tries to update
value's binding since static bindings do not allow this.
Tough to track down as, in this case, the stack trace shows that AbstractBinding.setString()
throwing the exception. My experience with coworkers this week is that encountering this issue is painful unless you are well familliar with the mechanics of bindings.
In other words, this *kills* newbies!
I have built a fix, yet to be checked in. All tests still run + I created a new test. I started in the T3 3.0 branch because a) The issue may be fixed in T4 already (have not checked yet) b) Spindle for T3 needs this fix.
The fix will detect the duplicate and build the message, "Tag <{0}> on line {1} contains more than one ''{2}'' attribute."
I think this is an error that should stop the template parse. But, if that is not desired, it could just be a logged event, or both. Pls, nobody suggest that the behaviour be configurable. This is happening at pretty much the lowest level in Tapestry and IMO it should be both an exception and a log entry. Doesn't matter to Spindle as the the mechanism for doing either suite me fine.
comments? |
Show » |
|