Results 1 to 3 of 3
  1. #1
    jfputnam is offline Member
    Join Date
    Oct 2008
    Posts
    2
    Rep Power
    0

    Default Referencing a collection size in JSTL

    I have a jsp page that is making me pull my hair out. I am trying to load a hidden variable with a list size passed into the page. The syntax is illuding me.

    I am using JBoss 4.2.2

    I have an interation that works fine but I need to load the hidden variable as well.

    <s:if test="shipmentStops!=null&& shipmentStops.size()>0">
    ...this test works...

    <s:hidden name="n" id="n" value="<How can I load this with shipmentStops.size()???>"/>

    <table width="100%">

    <s:iterator value="shipmentStops">
    ... this iterates fine I have 2 items in the list.


    Thanks for your help

    ---John Putnam

  2. #2
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    I don't think I can help with your current implementation, but why not just use EL's loop constructs?

  3. #3
    jfputnam is offline Member
    Join Date
    Oct 2008
    Posts
    2
    Rep Power
    0

    Default Reasons for construct

    It is not a loop issue within the JSP page but just being able to communicate the list size back to the action class to be able to loop though the numbered variables.

    It should be that there is an easy syntax to put the list size into the value of the the hidden field. It is referencible in the if but I can't pin down the syntax with struts-tags or ognl to dereference the size() of the list.

    It really am as much interested in finding out that syntax as solving this particular problem. So any tips are appreciated.

    Thanks,

    ---John Putnam

Similar Threads

  1. [SOLVED] Referencing Variable within Loop
    By Judoon_Platoon in forum Java Applets
    Replies: 2
    Last Post: 05-22-2008, 12:54 PM
  2. Problem using jstl and displaytags
    By NikhilSrivastava in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 02-18-2008, 12:01 PM
  3. Iterating through result set in JSTL
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-15-2008, 04:13 PM
  4. Referencing JPanel Class
    By uncopywritable in forum New To Java
    Replies: 2
    Last Post: 08-12-2007, 02:31 PM
  5. JSTL error
    By Eric in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 06-11-2007, 10:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •