Bug 7477 - mailer tag doesn't clear address property across use
Summary: mailer tag doesn't clear address property across use
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Mailer Taglib (show other bugs)
Version: 1.0
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2002-03-26 08:52 UTC by maiaux
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description maiaux 2002-03-26 08:52:58 UTC
A mail tag with both a "to" and a "cc" address mixes up the addresses if they 
are both declared via the "setrecipient" inner tag. Example:
<mt:mail subject="mailer taglib">
     <mt:setrecipient type="to">foo@home.net</mt:setrecipient>
     <mt:setrecipient type="cc">bar@home.net</mt:setrecipient>
     <mt:message>[body of message]</mt:message>
In this case the mail will only be sent (both as "to" and "cc") 
to "foo@home.net". The other address will simply be ignored.
This happens with Resin 2.0.5, which reuses the same object for tags that have 
the same syntax (as it is the case for the two "setrecipient" tags).
Under these assumptions, the implementation of doStartTag in SetRecipientTag is 
clearly incorrect, as you return SKIP_BODY if the address was previously set 
(where previously may mean "in a previous tag").
I cannot say if Resin is right or wrong, but people at Caucho claim that (I 
quote) "Resin's behavior is correct. Read JSP 10.1 for rules about tag reuse.". 
See also bug report http://www.caucho.com/quercus/bugtrack/view.xtp?
Comment 1 rich 2002-03-26 16:47:15 UTC
values are now reset after each invocation