private User user; //private UserDTO userDTO; public String add() { System.out.println("name=" + user.getName()); System.out.println("age=" + user.getAge()); return SUCCESS; }
public User getUser() { return user; }
public void setUser(User user) { this.user = user; }
}
package com.bjsxt.struts2.user.model;
public class User { private String name; private int age; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
public class User { private String name; private int age; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }