Re: STRUTS: c:set alternative to render dynamic links

Discussion in 'Java' started by Brock Heinz, Jul 30, 2003.

  1. Brock Heinz

    Brock Heinz Guest

    Hey Jack,

    I'm not sure what you mean when you say 'do it all in Struts' (but I'm
    assuming you mean that you want to do all of the data rendering with
    Struts tags rather than JSTL. Your direction (*that I am assuming*)
    is backwards from what the Struts contributors and developers are
    saying. They are urging developers to move towards using JSTL
    exclusively in their applications:

    http://jakarta.apache.org/struts/userGuide/dev_logic.html

    http://jakarta.apache.org/struts/userGuide/dev_bean.html

    But, if you want to just use Struts, I would ditch the <html:link ../>
    tag and just use a good old fashion HTML <a></a> tag.

    <logic:iterate id="person" name="findpersonresults">
    <a href="/editperson.do?reqParam=<bean:write name="person"
    property="seq""/>Your Link Here (maybe use another <bean:write../></a>

    Basically it boils down to this: the Struts tags are pretty weak.
    The core developers know it, and much of the community knows it. Use
    JSTL when possible and begin preparing for Java Server Faces (Craig
    McClanahan is the founder of Struts while also being the Spec Lead for
    faces). Here is the definitive mail archive for Struts questions:

    http://www.mail-archive.com//

    Hope this helps.

    Brock



    Jack <> wrote in message news:<Xns93C86FF305BABneverinamillioncom@127.0.0.1>...
    > Hi All!
    >
    > Currently I have a piece of code:
    >
    > <jsp:useBean id="paramMap" class="java.util.HashMap"/>
    > <c:set target="${paramMap}" property="action" value="Edit"/>
    > <nested:iterate id="person" name="findpersonresults">
    > <tr>
    > <c:set target="${paramMap}" property="personid"
    > value="${person.seq}">
    > <td><html:link action="/editperson.do" name="paramMap">
    > <nested:write name="person" property="seq"/></html:link></td>
    > <td><nested:write name="person" property="name"/></td>
    > </tr>
    > </nested:iterate>
    >
    > What I want is to get rid of the JSTL references and do it all in struts...
    > to put it simply, I want to render a link as:
    >
    > /editperson.do?action=Edit%personid=<nested:write name="person"
    > property="seq"/>
    >
    > Doesnt seem too efficient having to call the hashmap 100 (or whatever)
    > times every time someone does a search, but of course I cant embed a
    > nested:write in my html:link.
    >
    > Thanks
    > J
    Brock Heinz, Jul 30, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Watkins
    Replies:
    5
    Views:
    506
    Patrick Steele [MVP]
    Jan 6, 2004
  2. Lau Lei Cheong

    Page.Render do not render complete page

    Lau Lei Cheong, May 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,047
    Lau Lei Cheong
    May 15, 2004
  3. Wendy S
    Replies:
    0
    Views:
    430
    Wendy S
    Jul 30, 2003
  4. lightning
    Replies:
    0
    Views:
    577
    lightning
    Jul 14, 2008
  5. Glenn Gillen
    Replies:
    0
    Views:
    262
    Glenn Gillen
    Nov 17, 2006
Loading...

Share This Page