mythinky
08-30-2007, 11:43 PM
Hi All,
Based on the code, if I call the getAllPets() from http://localhost:8080/myapp/dwr/,
it will always return an array of null value. Any idea why it's so?
When I try returning the size of the list, it will return me 1.
When I call testStringList(), it will return an array of the string, which is [test String].
public class Pet {
private String id;
private String name;
private String type;
public Pet() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
public class PetService {
public List getAllPets(){
Pet pet = new Pet();
pet.setId("Pet1");
pet.setName("MyPuppy");
pet.setType("Dog");
List list = new ArrayList();
list.add(pet);
return list;
}
public List testStringList(){
List list = new ArrayList();
list.add(new String("test String"));
return list;
}
}
Thanks.
Based on the code, if I call the getAllPets() from http://localhost:8080/myapp/dwr/,
it will always return an array of null value. Any idea why it's so?
When I try returning the size of the list, it will return me 1.
When I call testStringList(), it will return an array of the string, which is [test String].
public class Pet {
private String id;
private String name;
private String type;
public Pet() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
public class PetService {
public List getAllPets(){
Pet pet = new Pet();
pet.setId("Pet1");
pet.setName("MyPuppy");
pet.setType("Dog");
List list = new ArrayList();
list.add(pet);
return list;
}
public List testStringList(){
List list = new ArrayList();
list.add(new String("test String"));
return list;
}
}
Thanks.