struts2 session 解读
程序员文章站
2023-12-01 09:08:40
httpsession < session = servletactioncontext.getrequest().getsession();  ...
httpsession < session = servletactioncontext.getrequest().getsession();
例:
public string findall(){
httpsession session = servletactioncontext.getrequest().getsession();
list = userservice.find();
session.setattribute("list", list);
return this.success;
}
在jsp中如何得到session中的属性呢:
如下:
s:iterator value="#session.list" id="user"
s:property value="user.userid"
s:property value="user.firstname"
s:property value="user.lastname"
s:iterator
例:
public string findall(){
httpsession session = servletactioncontext.getrequest().getsession();
list = userservice.find();
session.setattribute("list", list);
return this.success;
}
在jsp中如何得到session中的属性呢:
如下:
s:iterator value="#session.list" id="user"
s:property value="user.userid"
s:property value="user.firstname"
s:property value="user.lastname"
s:iterator