ModelDriven
返回具有空值NULL
的。params
豆:
public class MyBean
{
private String userName;
public void setUserName(String userName)
{
this.userName = userName;
}
public String getUserName()
{
return userName;
}
}
班级:
public class MyAction extends ActionSupport implements ModelDriven<MyBean>
{
MyBean myBean = new MyBean();
public String execute()
{
System.out.println(myBean.getUserName());//getting null here
return "SUCCESS";
}
}
要求:
/home/MyAction.do?userName=&pass=
听说我正在为userName
param 传递空值,但实际上我得到了null
值。
如何获得确切的价值ModelDriven
?