
Strut2学习
arron168
这个作者很懒,什么都没留下…
展开
-
Struts2的后台与前台数据交互处理方式的简单总结
1. 传值到Struts2的action方法: userName属性需要在访问的action中提供相应的属性,并有SET/GET方法。 可以不在访问的action中提供相应的属性,用request.getParameter(”userName”);2. 页面从Struts2的action取值方法: 4种拿到值得的办法: 1) 2) {username} 3) 4) 另外,在页面中使用set标签,用于将某个值放入指定的范围内,例如application,session等原创 2011-01-26 09:25:00 · 6958 阅读 · 1 评论 -
struts2从表单取值的三种方式
1,使用默认的action的传递方式。代码如下:public class LoginAction { private String username; private String password; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; }转载 2011-01-26 09:59:00 · 1036 阅读 · 0 评论