ITeye博客

Struts2前后台交互小结

RobertLiu0905 · 2014-10-28 09:23 · Struts2 · Web前端 · Struts · Markdown

[size=medium]1. 传值到Struts2的action方法:[/size] userName属性需要在访问的action中提供相应的属性,并有SET/GET方法。 可以不在访问的action中提供相应的属性,用request.getParameter(”userName”); [size=medium]2. 页面从Struts2的action取值方法:[/size] 4种拿到值得的办法: 1) 2) {username} 3) 4) 另外,在页面中使用set标签,用于将某个值放入指定的范围内,例如application,session等

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。