struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <david.k...@attws.com>
Subject RE: embedding email address in <html:link>
Date Thu, 24 Oct 2002 20:10:08 GMT
> -----Original Message-----
> From: Scott Hodson [mailto:scott@ubero.com]
> Sent: Thursday, October 24, 2002 12:54 PM
> 
> That doesn't work, I already tried it.  For starters, you'll 
> get errors
> because you're using double-quotes both in the <a> tag and 
> the embedded
> <bean:write> tag.  Once you fix that, the mailto: link will just be,
> literally, the <bean:write> tag, not is expected evaluation.
> 
> -----Original Message-----
> From: Madel,Kurt [mailto:kmadel@csmi.com] 
> 
> As your error suggests, you can't put a Struts tag in as the parameter
> of another Struts tag, but you can add a Struts tags as a 
> parameter of a
> regular html tag. This should work:
> 
> <logic:notEmpty name="contact" property="email">
>   <a href="mailto: <bean:write name="contact" property="email"
> filter="true" />">
>     <bean:write name="contact" property="email" filter="true" />
>   </a>
> </logic:notEmpty>

Although the proper scriptlet is probably the better solution here, the
problem of dueling quotes is easily solved by using single quotes around the
"href" attribute value and double quotes around the "bean:write" attributes,
like this:

  <a href='mailto: <bean:write name="contact" property="email" filter="true"
/>'>
    <bean:write name="contact" property="email" filter="true" />
  </a>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message