struts2值传递问题

[复制链接]
查看11 | 回复1 | 2011-4-25 11:11:14 | 显示全部楼层 |阅读模式
有一个jsp页面,页面中有一个form,form中有一个text文本框,有一个button,有一个submit,点击button和submit分别进入不同的Action,那么在点击botton后,怎么在Action中取出text文本框中的值?

回复

使用道具 举报

千问 | 2011-4-25 11:11:14 | 显示全部楼层
Action 中 生命变量:public String textName;生成set get函数public void setTextName(String textName){
this.textName = textName;}public String getTextName(){return this.textName}set函数即取前台text的值赋值给了后台execut函数中 直接用textName即text文本框的值。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行