Rather than storing the message key in a bean, can't you convert the key to
a message and store the message in the bean - then you cna just do a
<bean:write>.

If thats not appropriate - write your own tag to do it.

Niall

> -----Original Message-----
> From: Torsten Terp [mailto:[EMAIL PROTECTED]]
> Sent: 18 June 2001 11:19
> To: [EMAIL PROTECTED]
> Subject: RE: dynamic links in struts....
>
>
> Hi,
>
> You did understand me correctly, infact the code below was exactly what i
> wanted to avoid :-) I just thought that there were some other way
> of doing
> it that i might have overlooked (it has happend before :-)
>
> ...anyways, thanks for the response!
>
> ^terp
>
> > -----Original Message-----
> > From: Jon.Ridgway [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, June 18, 2001 12:09 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: dynamic links in struts....
> >
> >
> > Hi,
> >
> > If I understand the question correctly, then you would have to put your
> > dynamic message key into a scripting variable and use a
> scriplet. This isn't
> > very nice, as the point of struts it to remove scriplets from our jsps,
> > but...
> >
> > <bean:define id='key' name='<bean name>' property='<method name>'/>
> > <html:link page="/donor/Select.do" paramName="row" paramId="key"
> > paramProperty="donor">
> > <bean:message key="<%=key%>"/>
> > </html:link>
> >
> > Jon.
> >
> > -----Original Message-----
> > From: Torsten Terp [mailto:[EMAIL PROTECTED]]
> > Sent: 18 June 2001 10:47
> > To: [EMAIL PROTECTED]
> > Subject: RE: dynamic links in struts....
> >
> > ahh of course thats how to play it.... thank you!!!
> >
> > Another problem now occurs. If I need to use the bean:message in name
> > of the link, i.e.,
> >
> > <html:link page="/donor/Select.do" paramName="row" paramId="key"
> > paramProperty="donor">
> > <bean:message key="whatever"/>
> > </html:link>
> >
> > and this key value should be dynamic too, how do I accomplish this??
> >
> > ^torsten
> >
> > > -----Original Message-----
> > > From: Jon.Ridgway [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, June 18, 2001 11:06 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: dynamic links in struts....
> > >
> > >
> > > Hi,
> > >
> > > Have a look at this snip provided by Ted Husted a couple of
> days ago. Note
> > > the use of the html:link tag.
> > >
> > > 'Here's a reference snippet from a working page. The bean result has
> > > accessors for donor, sortName, email, and website, where
> donor is a unique
> > > key. Here the key is also used as the link text, but any
> other value from
> > > the bean could have been linked instead. This snippet
> generates links in
> > the
> > > form:'
> > >
> > > /donor/Select.do?key=1234
> > >
> > > where result.rows.getDonor() returns 1234
> > >
> > > <logic:iterate name="result" property="rows" id="row">
> > >     <td align="left">
> > >       <html:link page="/donor/Select.do" paramName="row" paramId="key"
> > > paramProperty="donor">
> > >         <bean:write name="row" property="donor" filter="true"/>
> > >       </html:link>
> > >     </td>
> > >     <td align="left">
> > >         <bean:write name="row" property="sortName" filter="true"/>
> > >     </td>
> > >     <td align="left" nowrap>
> > >       <bean:write name="row" property="telephone" filter="true"/>
> > >     </td>
> > >     <td align="left" nowrap>
> > >        <font size="1"><a href="mailto:<bean:write name="row"
> > > property="email"/>"><bean:write name="row" property="email"
> > > filter="true"/></a></font>
> > >     </td>
> > >     <td align="left">
> > >        <font size="1"><a href="http://<bean:write name="row"
> > > property="website"/>" target="_blank"><bean:write name="row"
> > > property="website" filter="true"/></a></font>
> > >     </td>
> > >   </tr>
> > > </logic:iterate>
> > >
> > >
> > > Jon.
> > >
> > >
> >
> >
>

Reply via email to