您的位置:首页 > 其它

Webwork标签之用法

2007-05-09 20:52 302 查看
<ww:combobox>和<ww:select>类似,但<ww:combobox>标签是把从select选中的数值放到一个input中显示

Action代码:

只要有一个combox变量就可以




package ch11;




import java.util.ArrayList;


import java.util.HashMap;


import java.util.Iterator;


import java.util.List;


import java.util.Map;




import com.opensymphony.xwork.ActionSupport;






public class ModifyUser extends ActionSupport ...{






private String combox;






public String execute() throws Exception ...{


System.out.println(this.Combox());





return SUCCESS;


}








public String getCombox() ...{


return combox;


}




public void setCombox(String combox) ...{


this.combox = combox;


}








}





JSP:

<ww:combobox label="state" name="combox"
list="{'Californam','Oregan'}"/>



运行jsp,选择select中的选项,可以看到,选中的数值赋值到了一个input中,提交后,后台打印出所选的内容
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: