You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jakarta <ja...@pandorus.com> on 2004/02/25 14:32:48 UTC

& dynamic URI

Greetings,

What I'd like to do is to dynamically write the URI of the Forward
attribute of the HTML:Link tag from a bean as follows:

<logic:iterate id="refVO" name="listRef" type="abc.ref.RefVO">
   <tr>
      <td class="darkGreyDescription">
         <br><html:link forward="<bean:write name="refVO"
property="link"/>" paramId="id"
         paramName="refVO" paramProperty= "tableID" styleClass="anchor">
         <bean:write name="refVO"
property="businessName"/></html:link>:&nbsp;
         <bean:write name="refVO" property="description"/>
      </td>
      <td></td>
   </tr>
</logic:iterate>

I get an Attribute refVO has no value error.

The idea is to have a JSP page with more than one possible link
depending on the data.
I have searched the mail archives without any success. :-(
Any help would be appreciated!

TIA,
Glenn

Re: & dynamic URI

Posted by Mark Lowe <ma...@talk21.com>.
html-el will do you. If you're running tc5 then you can use the 
expression syntax in standard tag libs (i think).

if not then .
<html-el:link page="${refVO.link}">

or

<html:link page ="<%= refVO.getLink() %>">

or

<a href="<c:url value="${refVO.link}" />">

If you get the jstl route then use c:forEach rather than iterate, 
although it will work with either.

On 25 Feb 2004, at 14:32, Jakarta wrote:

> Greetings,
>
> What I'd like to do is to dynamically write the URI of the Forward
> attribute of the HTML:Link tag from a bean as follows:
>
> <logic:iterate id="refVO" name="listRef" type="abc.ref.RefVO">
>    <tr>
>       <td class="darkGreyDescription">
>          <br><html:link forward="<bean:write name="refVO"
> property="link"/>" paramId="id"
>          paramName="refVO" paramProperty= "tableID" 
> styleClass="anchor">
>          <bean:write name="refVO"
> property="businessName"/></html:link>:&nbsp;
>          <bean:write name="refVO" property="description"/>
>       </td>
>       <td></td>
>    </tr>
> </logic:iterate>
>
> I get an Attribute refVO has no value error.
>
> The idea is to have a JSP page with more than one possible link
> depending on the data.
> I have searched the mail archives without any success. :-(
> Any help would be appreciated!
>
> TIA,
> Glenn


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


Re: & dynamic URI

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Someone else was struggling with this problem this week - they ended up
using the <logic:equal/notEqual> tags, but they only required two options.

If you want the conditional logic in your jsp then put it in either ...
1) Scriptlet
2) Struts logic tags
3) JSTL
4) Your own custom tag (maybe extending the <html:link> tag)

Niall
----- Original Message ----- 
From: "Jakarta" <ja...@pandorus.com>
To: <st...@jakarta.apache.org>
Sent: Wednesday, February 25, 2004 1:32 PM
Subject: <html:link> & dynamic URI


> Greetings,
>
> What I'd like to do is to dynamically write the URI of the Forward
> attribute of the HTML:Link tag from a bean as follows:
>
> <logic:iterate id="refVO" name="listRef" type="abc.ref.RefVO">
>    <tr>
>       <td class="darkGreyDescription">
>          <br><html:link forward="<bean:write name="refVO"
> property="link"/>" paramId="id"
>          paramName="refVO" paramProperty= "tableID" styleClass="anchor">
>          <bean:write name="refVO"
> property="businessName"/></html:link>:&nbsp;
>          <bean:write name="refVO" property="description"/>
>       </td>
>       <td></td>
>    </tr>
> </logic:iterate>
>
> I get an Attribute refVO has no value error.
>
> The idea is to have a JSP page with more than one possible link
> depending on the data.
> I have searched the mail archives without any success. :-(
> Any help would be appreciated!
>
> TIA,
> Glenn
>



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