Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Struts and the fly likes accesing value from list of string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "accesing value from list of string" Watch "accesing value from list of string" New topic

accesing value from list of string

ekansh singh

Joined: Mar 05, 2009
Posts: 5
hello all
I am new to struts 2.
I am having List of string in action classs
List<String> categories

this class has getter and setters

now there is a guide.jsp

<s:iterator value="categories">


<s:url id="categoryInformation" action="ShowCategoryInformation.action">
<s:param name="categoryName" value ="" />
<s:a href="%{categoryInformation}">


i know how to display the value stored in the list .. i mean i can use this <s:property/>
but here I want to make the url

<s:url id="categoryInformation" action="ShowCategoryInformation.action">
<s:param name="categoryName" value ="" />

and this VALUE in <s:param name="categoryName" value ="" /> >

should be the the string present in th list..
can you please tell me how to get each string value from the list the value attribute of Param tag
David Newton

Joined: Sep 29, 2008
Posts: 12617

Use the iterator tag's "id" (S2.0) or "var" (S2.1) attribute to hold each object of iteration then refer to it in the param tag:
I agree. Here's the link:
subject: accesing value from list of string
Similar Threads
Update Database with the newly entered value
List values are not bind with text fields
Struts2 <s:iterator /> question
oracle database view+entity
passing form parameters such us textfield values using url tag