Results 1 to 3 of 3
- 10-08-2008, 12:43 AM #1
Member
- Join Date
- Oct 2008
- Posts
- 2
- Rep Power
- 0
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
- 10-08-2008, 09:04 AM #2
I don't think I can help with your current implementation, but why not just use EL's loop constructs?
- 10-08-2008, 04:02 PM #3
Member
- Join Date
- Oct 2008
- Posts
- 2
- Rep Power
- 0
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
-
[SOLVED] Referencing Variable within Loop
By Judoon_Platoon in forum Java AppletsReplies: 2Last Post: 05-22-2008, 11:54 AM -
Problem using jstl and displaytags
By NikhilSrivastava in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 02-18-2008, 11:01 AM -
Iterating through result set in JSTL
By Java Tip in forum Java TipReplies: 0Last Post: 01-15-2008, 03:13 PM -
Referencing JPanel Class
By uncopywritable in forum New To JavaReplies: 2Last Post: 08-12-2007, 01:31 PM -
JSTL error
By Eric in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 06-11-2007, 09:36 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks