[code="java"]
action中 FreightPolicyQueryAction extends ActionSupport implements
ServletRequestAware, ModelDriven
.....
String[] insurance = new String[2];
insurance[0] = "1";
insurance[1] = "2";
LOG.info(insurance.length);
getModel().setInsurance(insurance);//给驱动模型设置值
if (getModel().getInsurance() != null) {
LOG.info(getModel().getInsurance().length);
for (int i = 0; i < getModel().getInsurance().length; i++) {
LOG.info(getModel().getInsurance()[i]);
}
}
return "fpQueryInit";
[/code]
[code="java"]
labelposition="right" list="#{'1':'国内','2':'进口'}"
listKey="key" listValue="value">/s:checkboxlist
[/code]
想实现的就是从action中给jsp设置checkboxlist的值...网上找了一下,好象设置同名的数组就可以了.我的insurance是在modeldriven中写的.