1.如下图:
2.UserAction.java
package com.eduask.action;
import com.eduask.entity.User;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
public class UserAction extends ActionSupport implements ModelDriven<User>{
private User user=new User();
//list
public String user_list(){
System.out.println(user.getUsername());
System.out.println(user.getPassword());;
return "user_list";
}
//add
public String user_add(){
return "user_add";
}
public User getModel() {
return user;
}
}