在后台谢了代码
如class LoginAction{
...
private String username;
setter和getter方法。。。
...
@Override
public String execute() throws Exception {
if(this.getUsername().equals("zcw")&&this.getPassword().equals("zcw")){
ActionContext.getContext().getSession().put("user", username);//还可ActionContext.getContext().getSession().put("user", this.getUsername());
return SUCCESS;
}else{
return ERROR;
}
}
}
在jsp的页面里取值
<s:text name="succTip">
<s:param>${sessionScope.user}</s:param>
</s:text>