我在做学一个jsp的web的项目,使用的是struts2+spring2做的,遇到了一个很困惑的问题,好久不能解决,今拿出来请大家帮忙解决,先在此谢过
数据库:
item有三个表项itemid,itemname,itemcode
subitem有四个表项subid,itemid,subname,subcode是一对多关系
ItemAction.java
Item.jsp
从Debug可看出,item.jsp取到了itemall值,并且相应subitem也正确,第一个下拉是好的,第二个下拉提示struts模板错误,望各位指正。
异常:
数据库:
item有三个表项itemid,itemname,itemcode
subitem有四个表项subid,itemid,subname,subcode是一对多关系
ItemAction.java
public String execute() throws Exception {
List itemall = this.itemService.findAll();//可以查询出包括subitem在内的所有表
if (itemall.size() != 0) {
session = (Map) ActionContext.getContext().getSession;
session.put("itemall", itemall);
return SUCCESS;
} else {
this.addActionError("分类不存在");
return ERROR;
}
}
Item.jsp
<s:doubleselect list="#session.itemall" listValue="itemname" doubleName="subitem"
doubleList="#session.itemall[subitem]" doubleListValue="subname" label="Item" />
从Debug可看出,item.jsp取到了itemall值,并且相应subitem也正确,第一个下拉是好的,第二个下拉提示struts模板错误,望各位指正。
异常:
freemarker.core.InvalidReferenceException: Expression parameters.formName is undefined on line 98, column 43 in template/simple/doubleselect.ftl