You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Rosenblum <ja...@cnet.com> on 2001/06/19 02:15:11 UTC

Creating a mailto within a

Hi,

I'm stuck on what seems like an easy task and I need some help! Here's my code:

<!-- START LOOP -->
<logic:iterate id="result" name="psrBean" property="projectByCriteria" scope="request">
    <html:link page="/findByName.do" paramId="id" paramName="result" paramProperty="ID">
    <bean:write name="result" property="name"/></html:link>
    <bean:write name="result" property="shortDescription"/>
    <a href="mailto:<bean:write name="result" property="email"/>"><bean:write name="result" property="manager"/></a>
</logic:iterate>
<!-- END LOOP -->

I'm iterating through an array of beans returned by the property projectByCriteria of the psrBean bean. My problem is that I cannot get the email address to dynamically populate the <a href="mailto: ... >. There does not appear to be any tags that handle mailto's. I tried looking more closely at the <html:link> tag, but I haven't found anything to help me solve this problem. Any thoughts?

~Jason Rosenblum

Re: Creating a mailto within a

Posted by Martin Cooper <ma...@tumbleweed.com>.
Instead of this:

<a href="mailto:<bean:write name="result" property="email"/>"><bean:write
name="result" property="manager"/></a>

try this:

<bean:define id="email" name="result" property="email"
type="java.lang.String"/>
<a href='<%= "mailto:" + email %>'><bean:write name="result"
property="manager"/></a>

Hope this helps.

--
Martin Cooper


----- Original Message -----
From: "Jason Rosenblum" <ja...@cnet.com>
To: <st...@jakarta.apache.org>
Sent: Monday, June 18, 2001 5:15 PM
Subject: Creating a mailto within a <logic:iterate>


> Hi,
>
> I'm stuck on what seems like an easy task and I need some help! Here's my
code:
>
> <!-- START LOOP -->
> <logic:iterate id="result" name="psrBean" property="projectByCriteria"
scope="request">
>     <html:link page="/findByName.do" paramId="id" paramName="result"
paramProperty="ID">
>     <bean:write name="result" property="name"/></html:link>
>     <bean:write name="result" property="shortDescription"/>
>     <a href="mailto:<bean:write name="result"
property="email"/>"><bean:write name="result" property="manager"/></a>
> </logic:iterate>
> <!-- END LOOP -->
>
> I'm iterating through an array of beans returned by the property
projectByCriteria of the psrBean bean. My problem is that I cannot get the
email address to dynamically populate the <a href="mailto: ... >. There does
not appear to be any tags that handle mailto's. I tried looking more closely
at the <html:link> tag, but I haven't found anything to help me solve this
problem. Any thoughts?
>
> ~Jason Rosenblum



RE: Creating a mailto within a

Posted by Niall Pemberton <ni...@btInternet.com>.
I tried what you have below and it works fine.

<a href="mailto:<bean:write name="result"  property="email"/>"><bean:write
name="result" property="manager"/></a>

Niall

> -----Original Message-----
> From: Jason Rosenblum [mailto:jason.rosenblum@cnet.com]
> Sent: 19 June 2001 01:15
> To: 'struts-user@jakarta.apache.org'
> Subject: Creating a mailto within a <logic:iterate>
>
>
> Hi,
>
> I'm stuck on what seems like an easy task and I need some help!
> Here's my code:
>
> <!-- START LOOP -->
> <logic:iterate id="result" name="psrBean"
> property="projectByCriteria" scope="request">
>     <html:link page="/findByName.do" paramId="id"
> paramName="result" paramProperty="ID">
>     <bean:write name="result" property="name"/></html:link>
>     <bean:write name="result" property="shortDescription"/>
>     <a href="mailto:<bean:write name="result"
> property="email"/>"><bean:write name="result" property="manager"/></a>
> </logic:iterate>
> <!-- END LOOP -->
>
> I'm iterating through an array of beans returned by the property
> projectByCriteria of the psrBean bean. My problem is that I
> cannot get the email address to dynamically populate the <a
> href="mailto: ... >. There does not appear to be any tags that
> handle mailto's. I tried looking more closely at the <html:link>
> tag, but I haven't found anything to help me solve this problem.
> Any thoughts?
>
> ~Jason Rosenblum
>