Struts bean:define标签用法

bean:define:有三个用途

一是定义新字符串常量:
<bean:define id="foo" value="This is a new String"/>
<bean:define id="bar" value='<%= "Hello, " + user.getName() %>'/>
<bean:define id="last" scope="session" value='<%= request.getRequestURI() %>'/>
       
二是复制一个现有的bean给新的bean:
<bean:define id="foo" name="bar"/>    // 将名字为bar的JavaBean赋值给foo
<bean:define id="baz" name="bop" type="com.mycompany.MyClass"/> // 额外定义脚本变量的类型,默认为Object
       
三是复制一个现有的bean的属性给新的bean:
<bean:define id="bop" name="user" property="role[3].name"/>
<bean:define id="foo" name="bar" property="baz" scope="request" toScope="session"/>
//toScope属性指新bean的scope,默认为page   
上段代码的意思是把名为bar的bean的baz属性赋值给foo,foo的类型为String(默认)。
 
如下:在列表中 把每一个checkbox的值设为每一条数据的customerID值

把选中的框的值放到数组中

原文地址:https://www.cnblogs.com/wuxu/p/10245119.html