You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Reynolds <ji...@gmail.com> on 2005/11/29 22:04:22 UTC

create URL (Struts or Core Tags From Iteration)

I created a FormBean which holds a list of POJOs. The FormBean has a
method called getPOJOs() which returns a list. In my JSP page, I am
iterating over the list like so:

<logic:iterate id="POJO" name="FormBean">

and that appears to get each POJO object and I can get data from it like so:
<html:text name="POJO" property="name"/>

and all is good.

But I need to create a url so I am trying this:
<c:url value="/headon.do" var="link">
   <c:param name="name" value="XXXXXXXXXXproblem here" />
</c:url>

No matter what I try I cannot seem to get a proper link build:
I have tried
<c:param name="name" value="<c:out value='${POJO.name}'/>"/>
and
bean:write
,etc

How can I get this to work? Any ideas.

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


Re: create URL (Struts or Core Tags From Iteration)

Posted by Michael Jouravlev <jm...@gmail.com>.
On 11/29/05, Wendy Smoak <ws...@gmail.com> wrote:
> On 11/29/05, Michael Jouravlev <jm...@gmail.com> wrote:
>
> > <a href="<c:url value="/headon.do">
> >     <c:param name="myname">
> >       <c:out value="${POJO.name}" />
> >     </c:param>
> >   </c:url>">The link</a>
>
> <c:param name="myname" value="${POJO.name}" /> ?

Doh! One shan't overcomplicate :-)

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


Re: create URL (Struts or Core Tags From Iteration)

Posted by Jim Reynolds <ji...@gmail.com>.
Thanks to all for the assistance, your help is greatly appreciated.




On 11/29/05, Jim Reynolds <ji...@gmail.com> wrote:
> On 11/29/05, Wendy Smoak <ws...@gmail.com> wrote:
> > On 11/29/05, Michael Jouravlev <jm...@gmail.com> wrote:
> >
> > > <a href="<c:url value="/headon.do">
> > >     <c:param name="myname">
> > >       <c:out value="${POJO.name}" />
> > >     </c:param>
> > >   </c:url>">The link</a>
> >
> > <c:param name="myname" value="${POJO.name}" /> ?
> >
> > --
> > Wendy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

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


Re: create URL (Struts or Core Tags From Iteration)

Posted by Jim Reynolds <ji...@gmail.com>.
On 11/29/05, Wendy Smoak <ws...@gmail.com> wrote:
> On 11/29/05, Michael Jouravlev <jm...@gmail.com> wrote:
>
> > <a href="<c:url value="/headon.do">
> >     <c:param name="myname">
> >       <c:out value="${POJO.name}" />
> >     </c:param>
> >   </c:url>">The link</a>
>
> <c:param name="myname" value="${POJO.name}" /> ?
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: create URL (Struts or Core Tags From Iteration)

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/29/05, Michael Jouravlev <jm...@gmail.com> wrote:

> <a href="<c:url value="/headon.do">
>     <c:param name="myname">
>       <c:out value="${POJO.name}" />
>     </c:param>
>   </c:url>">The link</a>

<c:param name="myname" value="${POJO.name}" /> ?

--
Wendy

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


Re: create URL (Struts or Core Tags From Iteration)

Posted by Michael Jouravlev <jm...@gmail.com>.
On 11/29/05, Michael Jouravlev <jm...@gmail.com> wrote:
> On 11/29/05, Jim Reynolds <ji...@gmail.com> wrote:
> > I created a FormBean which holds a list of POJOs. The FormBean has a
> > method called getPOJOs() which returns a list. In my JSP page, I am
> > iterating over the list like so:
> >
> > <logic:iterate id="POJO" name="FormBean">
> >
> > and that appears to get each POJO object and I can get data from it like so:
> > <html:text name="POJO" property="name"/>
> >
> > and all is good.
> >
> > But I need to create a url so I am trying this:
> > <c:url value="/headon.do" var="link">
> >    <c:param name="name" value="XXXXXXXXXXproblem here" />
> > </c:url>
> >
> > No matter what I try I cannot seem to get a proper link build:
> > I have tried
> > <c:param name="name" value="<c:out value='${POJO.name}'/>"/>
> > and
> > bean:write
> > ,etc
> >
> > How can I get this to work? Any ideas.
>
> How about:
> ------------
>
>   <c:url value="/headon.do">
>     <c:param name="myname">
>       <c:out value="${POJO.name}" />
>     </c:param>
>   </c:url>
>
> You cannot put tag into tag, but if it is a "value" attribute, then it
> is usually can be treated as an element body.

I forgot <a> tag to make it a link:

<a href="<c:url value="/headon.do">
    <c:param name="myname">
      <c:out value="${POJO.name}" />
    </c:param>
  </c:url>">The link</a>

Michael.

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


Re: create URL (Struts or Core Tags From Iteration)

Posted by Michael Jouravlev <jm...@gmail.com>.
On 11/29/05, Jim Reynolds <ji...@gmail.com> wrote:
> I created a FormBean which holds a list of POJOs. The FormBean has a
> method called getPOJOs() which returns a list. In my JSP page, I am
> iterating over the list like so:
>
> <logic:iterate id="POJO" name="FormBean">
>
> and that appears to get each POJO object and I can get data from it like so:
> <html:text name="POJO" property="name"/>
>
> and all is good.
>
> But I need to create a url so I am trying this:
> <c:url value="/headon.do" var="link">
>    <c:param name="name" value="XXXXXXXXXXproblem here" />
> </c:url>
>
> No matter what I try I cannot seem to get a proper link build:
> I have tried
> <c:param name="name" value="<c:out value='${POJO.name}'/>"/>
> and
> bean:write
> ,etc
>
> How can I get this to work? Any ideas.

How about:
------------

  <c:url value="/headon.do">
    <c:param name="myname">
      <c:out value="${POJO.name}" />
    </c:param>
  </c:url>

You cannot put tag into tag, but if it is a "value" attribute, then it
is usually can be treated as an element body.

Michael.

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