社区
Web 开发
帖子详情
请问怎么使用struts显示session中username的内容?感谢
立志做一个佳娃~
2006-08-14 09:01:13
<bean:write name="session" property="username"/>
我现在使用这个不好使,啥也不显示,是不是我使用错标签了,感谢
...全文
123
3
打赏
收藏
请问怎么使用struts显示session中username的内容?感谢
我现在使用这个不好使,啥也不显示,是不是我使用错标签了,感谢
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
Areslp
2006-08-15
打赏
举报
回复
<bean:write name="username"/>或者session.getAttribute("username")
SafeSoft
2006-08-14
打赏
举报
回复
加分.....
crackYY
2006-08-14
打赏
举报
回复
name属性应该是属性名称,或用jstl<c:out value=${property}/>,官方也提倡使用jstl来代替这些struts标签
<bean:write name="propertyName" property="username"/>
Struts
2
中
Session
的
使用
在
Struts
2里,如果需要在Action
中
使用
session
,可以通过下面两种方式得到 1.通过ActionContext class
中
的方法get
Session
得到 2.Action实现org.apache.
struts
2.interceptor.
Session
Aware接口的方式来对
session
进行...
Struts
2
中
Session
的
使用
在
Struts
2里,如果需要在Action
中
使用
session
,可以通过下面两种方式得到 1.通过ActionContext class
中
的方法get
Session
得到 2.Action实现org.apache.
struts
2.interceptor.
Session
Aware接口的方式来对
session
进行...
Struts
中
Session
用法
在
Struts
2里,如果需要在Action
中
使用
session
,可以通过下面两种方式得到 1.通过ActionContext class
中
的方法get
Session
得到 2.Action实现org.apache.
struts
2.interceptor.
Session
Aware接口的方式来对
session
进行...
在
Struts
2
中
存储
session
在src/action/UserAction
中
的login方法
中
: if (
userName
.equals("张三")) { Map, Object>
session
= ActionContext.getContext() .get
Session
();
session
.put("currUse
struts
2.0
中
jsp获取
session
信息
session
值,获取从表单提交的数据信息 action类
中
代码如下: ActionContext ac=ActionContext.getContext(); Map map=ac.get
Session
(); map.put("
username
",
username
); map.put("password", password); ...
Web 开发
81,122
社区成员
341,744
社区内容
发帖
与我相关
我的任务
Web 开发
Java Web 开发
复制链接
扫一扫
分享
社区描述
Java Web 开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章