Issue Details (XML | Word | Printable)

Key: TAPESTRY-431
Type: Bug Bug
Status: Resolved Resolved
Resolution: Duplicate
Priority: Minor Minor
Assignee: Unassigned
Reporter: Geoff Longman
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Tapestry

TemplateParser silently discards tag attributes if there are duplicates

Created: 23/Jul/05 11:24 AM   Updated: 24/Aug/05 07:41 AM
Return to search
Component/s: Framework
Affects Version/s: 3.0.5
Fix Version/s: None

Time Tracking:
Issue & Sub-Tasks
Issue Only
Not Specified

Issue Links:
Duplicate
 

Resolution Date: 24/Aug/05 07:41 AM

Sub-Tasks  All   Open   
No sub-tasks match this view.

 Description  « Hide
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?

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Geoff Longman added a comment - 23/Jul/05 11:42 AM
Since nobody seems to be working in the 3.0 branch anymore I'm going to commit this. The changed behaviour is that the TemplateParser will throw an Exception. If it needs to be changed I'll do it then.

Geoff Longman added a comment - 25/Jul/05 02:13 AM
I do not seem to have the ability to assign, update, or close issues. TAPESTRY-431 should be closed as fixed.