| Author |
display selective value from VECTOR
|
aamchi mumbai
Greenhorn
Joined: Mar 04, 2005
Posts: 19
|
|
Hi, Suppose i have vector v = new Vector(); v.add("one"); v.add("two"); v.add("three"); v.add("four"); Now i want to display only value "one" and "three". how can i write struts tag do display that value? is there any documentation where i can get all this information? Again Thanks in advance
|
 |
Vicky Pandya
Ranch Hand
Joined: Dec 16, 2004
Posts: 148
|
|
|
use logic:equal to compare your values.
|
 |
aamchi mumbai
Greenhorn
Joined: Mar 04, 2005
Posts: 19
|
|
Originally posted by Vicky Pandya: use logic:equal to compare your values.
what if i dont know the value i just know the index number
|
 |
aamchi mumbai
Greenhorn
Joined: Mar 04, 2005
Posts: 19
|
|
|
Anyone knows answer for this
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
Check out the following link on using indexed properties. It explains how to do it: http://struts.apache.org/faqs/indexedprops.html
|
Merrill
Consultant, Sima Solutions
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
Most struts tags are designed to work with a javaBean. A Vector is not a javaBean. Therefore, in order to do what you want using struts tags, you will need to embed the Vector in a javaBean. Usually, in Struts applications, you embed the data you're working with in a bean that is a subclass of ActionForm. If this doesn't fit your model, then don't use Struts tags. Use jstl, or just plain old scriptlets. Keeping in mind the above explanation, here is some code that will work: Action form: Action Class: jsp:
|
 |
 |
|
|
subject: display selective value from VECTOR
|
|
|