Bug 7477

Summary: mailer tag doesn't clear address property across use
Product: Taglibs Reporter: maiaux <dm>
Component: Mailer TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: CLOSED FIXED    
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

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>
     <mt:send/>
</mt:mail>
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?
bugreport_id=233
Comment 1 rich 2002-03-26 16:47:15 UTC
values are now reset after each invocation