好想没有这个标签啊
package com.ls.action;
import com.ls.entity.User;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
public class LoginAction extends ActionSupport implements ModelDriven<User>{
private static final long serialVersionUID = 2420947456421303802L;
private User user =new User();
public String login() {
if(user.getUsername()==null || " ".equals(user.getUsername())){
this.addFieldError("username", "姓名不能为空");
return INPUT;
}
System.out.println(user.getUsername());
System.out.println(user.getBookList().get(0).getUsername());
System.out.println(user.getBookList().get(1).getUsername());
return SUCCESS;
}
@Override
public User getModel() {
// TODO Auto-generated method stub
return user;
}
}