You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Scott Hodson <sc...@ubero.com> on 2002/10/24 20:18:59 UTC
embedding email address in
I have a contact bean, which stores contact info. While displaying
contact info I want to show the e-mail address as well as having a
mailto: hyperlink to the email address.
<logic:notEmpty name="contact" property="email">
<html:link href="mailto:????">
<bean:write name="contact" property="email" filter="true" />
</html:link>
</logic:notEmpty>
What do I replace ???? with? I've tried all of the following and none
work
<logic:notEmpty name="contact" property="email">
<html:link href="mailto:<%=contact.getEmail()%>">
<bean:write name="contact" property="email" filter="true" />
</html:link>
</logic:notEmpty>
...and...
<logic:notEmpty name="contact" property="email">
<html:link href="mailto:<bean:write name='contact' property='email'
filter='true' />">
<bean:write name="contact" property="email" filter="true" />
</html:link>
</logic:notEmpty>
...and...
<logic:notEmpty name="contact" property="email">
<bean:define id="emailAddress" name="contact" property="email" />
<html:link href="mailto:<%=emailAddress%>" />">
<bean:write name="contact" property="email" filter="true" />
</html:link>
</logic:notEmpty>
I'm not sure what else to try. I don't want to have to create my own
tag lib just to do this, and I don't want to have to create a whole new
getXXX() on my bean to return a proper mailto href, that would be
putting presentation logic in a bean, which violates MVC.
___________________________
Scott Hodson
(949) 709-4496 office
(949) 709-3890 fax
scott@ubero.com
http://www.ubero.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>