You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Geoff Longman (JIRA)" <ta...@jakarta.apache.org> on 2005/07/23 04:47:47 UTC

[jira] Commented: (TAPESTRY-431) TemplateParser silently discards tag attributes if there are duplicates

    [ http://issues.apache.org/jira/browse/TAPESTRY-431?page=comments#action_12316560 ] 

Geoff Longman commented on TAPESTRY-431:
----------------------------------------

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.

> TemplateParser silently discards tag attributes if there are duplicates
> -----------------------------------------------------------------------
>
>          Key: TAPESTRY-431
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-431
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 3.0.3
>     Reporter: Geoff Longman
>     Priority: Minor

>
> 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?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org