struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Piotr Falenczyk <>
Subject Struts2, collection of objects and JSP
Date Thu, 07 Feb 2008 11:32:39 GMT


I have a following problem

I have an action defined, let's say:

public class SomeAction extends ActionSupport implements SessionAware{

private Map sessionMap;

	public String execute() throws Exception {

		return SUCCESS;

        public void setSession(Map map) {
		this.sessionMap = map;

	public long getSideId() {
		return sideId;

	public List<Import> getImports() {
		return (List<Import>)sessionMap.get("imports");
	public void setImports(List<Import> imports) {
		sessionMap.set("imports", imports);


The Import class is a simple POJO

public class Import extends Serialicable {

private String name;

        public String getName() {
		return name;
	public void setName(String name) { = name;


I need to display all the names of Imports, and allow to edit every one of
them in one page. What I do now is somethin like that ion JSP. Displaying
values work just fine, but I canno't change them (not stored back in the

<s:iterator value="imports">

<s:textfield name="name" /> </br>


What I know is that I need to set for name of every textfield
"imports[index_in_list].name" in order to make it work, but how can I do it?

Thanks for help in advance

Piotr Falenczyk
View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message