Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

url, fill collection

Jaan Tark

2007-05-15

Replies:

Hello,

i have a class

public class Person {
  private String name;
  // gettter, setter
}

contained in

public class Master extends ActionSupport {
 
  private Vector<Person> persons;

  //getters, setters
 
  publis String execute() {
  return SUCCESS;
  }

}

i can retrieve persons in jsp like this:
<s:iterator value="persons">
  <s:property value="name">
</s:iterator>


how to i fill the vector via URL (GET)?
(e.g. "....?persons.name=test)

if the vector contains primitive types - int, string ... , i''m able to
fill it ... but having trouble with vector (collections) that contain
smth like shown

rgds

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.