现在有个页面是正常的,是别人写的我仿照写了一个,就不正常了。。<jsp:useBean id="deviceMaintainForm"
class="com.huaweisymantec.smartlabr2.bean.DeviceMaintainForm"
scope="request">
<jsp:setProperty name="deviceMaintainForm" property="*" />
</jsp:useBean>
我debug一下,发现deviceMaintainForm都已经赋值了
deviceMaintainForm代码中,
private List<DeviceTypeVO>
allDeviceTypeVOList = null;
public List<GroupVO> getAllGroupVOList() {
return allGroupVOList;
}
public void setAllGroupVOList(List<GroupVO> allGroupVOList) {
this.allGroupVOList = allGroupVOList;
}我重新写了个页面,同样的代码
可 allDeviceTypeVOList = null;
没有被赋值,还是null。。我想知道那个正常的页面,是怎样把allDeviceTypeVOList给赋值了。。
class="com.huaweisymantec.smartlabr2.bean.DeviceMaintainForm"
scope="request">
<jsp:setProperty name="deviceMaintainForm" property="*" />
</jsp:useBean>
我debug一下,发现deviceMaintainForm都已经赋值了
deviceMaintainForm代码中,
private List<DeviceTypeVO>
allDeviceTypeVOList = null;
public List<GroupVO> getAllGroupVOList() {
return allGroupVOList;
}
public void setAllGroupVOList(List<GroupVO> allGroupVOList) {
this.allGroupVOList = allGroupVOList;
}我重新写了个页面,同样的代码
可 allDeviceTypeVOList = null;
没有被赋值,还是null。。我想知道那个正常的页面,是怎样把allDeviceTypeVOList给赋值了。。
这句实现了赋值
property="*"应该是对deviceMaintainForm中所有属性给赋值了
</jsp:useBean>你什么时候传值了?
<jsp:setProperty name="deviceMaintainForm" property="*" />这句就是关键 property="*" 有特殊的含义 可以自动将表单的数据赋值给bean
本来parameters还是有值的
parsedParams是true我加了<jsp:useBean 后
也就是新建实例以后request里
parameters成了null
parsedParams成了false悲剧啊。。
哪部分啊?
JSP的?标签库封装了很多
java的?