码迷,mamicode.com
首页 > 其他好文 > 详细

struts2的传值方式

时间:2014-10-18 15:35:40      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:struts2   struts   



public String getValue()
{
this.username = "tomcat";
this.password = "123456";
this.nickname = "tomcat nick";
ActionContext.getContext().put("user", "this is a user");
ServletActionContext.getRequest().setAttribute("pd", "this is a password");
return "value";

}


以上是三种传值方式



下面是EL表达式与OGNL表达式的显示值的试。

el:{usrename}<br/>
el:{password}<br/>
el:{nickname}<br/>
el:{user}<br/>
el:{pd}<br/>




struts:<s:property value="username"/><br/>
struts:<s:property value="password"/><br/>
struts:<s:property value="nickname"/><br/>
struts:<s:property value="user"/><br/>
struts:<s:property value="#request.pd"/><br/>

struts2的传值方式

标签:struts2   struts   

原文地址:http://blog.csdn.net/revent/article/details/40210707

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!