struts2中s:doubleselect问题

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 17:25   1509   0
我在做学一个jsp的web的项目,使用的是struts2+spring2做的,遇到了一个很困惑的问题,好久不能解决,今拿出来请大家帮忙解决,先在此谢过
数据库:
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
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP