struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <>
Subject RE: Struts url, a, and iterator tag behaviour
Date Fri, 28 May 2010 18:59:23 GMT

Hi Ken-


org.apache.struts2.views.jsp.URLTag entries for 'id' attribute..accessor or mutator..

     * To keep backward compatibility 
     * TODO remove after 2.1
    public void setId(String id) {


could you point out to greg or myself which doc says id or setId is valid?


Martin Gainty 
Note de déni et de confidentialité
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire
prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe
quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information
seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les
email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune
responsabilité pour le contenu fourni.


Subject: Re: Struts url, a, and iterator tag behaviour
Date: Fri, 28 May 2010 11:58:44 -0600

I still don't know what caused the issue.  Using just the <a> tag revealed that  ${companyId}
was null, producting <a href=""> tags.
So I removed the id from the <s:url> tag... and then embedded the the whole <s:url>
tag into the <a> tag, and it works as expected...

<a href='<s:url action="companyDetails.action" namespace="/secure"><s:param name="group"
value=""/><s:param name="id" value=""/></s:url>'>
   <s:property value="cur.mco"/>

My issue is it isn't pretty. Okay just out of interest I added  id="something" to <s:url>
and the html is back to <a href=''>... So the id attribute causes the tag not to return
a value and pushes the url onto the value stack as the name of the id attribute?  

The usage example here suggests this too: 

On Fri, 2010-05-28 at 08:34 -0400, Greg Lindholm wrote: 
Use the "href" not the "value" attribute to specify the URL.

Unless you are use the tag ajax support there is no reason to use the
<s:a> tag just use the plain html <a> tag

like <a href="${companyId}">

On Thu, May 27, 2010 at 8:38 PM, Ken <> wrote:
> I am trying to dynamically construct a url inside an iterator tag and
> use that result in an anchor.
>        <s:iterator value="next">
>            <s:url  id="companyId" action="companyDetails.action"
> namespace="/secure">
>                <s:param name="group" value=""/>
>                <s:param name="id" value=""/>
>            </s:url>
>            <tr>
>                <td><s:property value=""/></td>
>                <td><s:property value=""/></td>
>                <td><s:property value="log.mlco"/></td>
>                <td><s:a value="%{companyId}"><s:property
> value="cur.mco"/></s:a></td>
>            </tr>
>        </s:iterator>
> This is producing the following html:
> (Showing two iterations only)
> <tr>
>                <td>01  </td>
>                <td>24737</td>
>                <td>****  TEST ** FOCUS INDUSTRIAL ****                        
>                <td><a>****  TEST ** FOCUS INDUSTRIAL ****     </a></td>
>            </tr>
>            <tr>
>                <td>01  </td>
>                <td>07777</td>
>                <td>==================+** THE TEST COMPANY  **+================================</td>
>                <td><a>CASH ** THE TEST COMPANY  **            </a></td>
>            </tr>
> Any Ideas?

To unsubscribe, e-mail:
For additional commands, e-mail:

Ken McWilliams
A E Rose Information Service Ltd.
PO Box 3473

15A Alberta Avenue
Spruce Grove  AB
T7X 3A7
Phone:  780 948-0012
Fax:       780 948-0052

The New Busy is not the old busy. Search, chat and e-mail from your inbox.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message