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/>
时间: 2024-10-11 06:29:15