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>

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170


-----Original Message-----
From: Scott Hodson [mailto:scott@;ubero.com] 
Sent: Thursday, October 24, 2002 2:19 PM
To: Struts
Subject: embedding email address in <html:link>

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
[EMAIL PROTECTED]
http://www.ubero.com



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

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

Reply via email to