Struts2:doubleselect 标签错误,进来看一下 10
1.流程:[create.jsp页面有个<s:action/>,有个表单]-->[表单提交到Action,成功]-->[转到create.jsp];2.<s:action...
1.流程:[create.jsp页面有个<s:action/>,有个表单] --> [表单提交到Action,成功] --> [转到create.jsp];
2.<s:action/>标签请求了一个另外一个Action,获得一个List<School>和一个Map<School,List<SchoolClass>>存储在request中,List<School>是一级下拉框所需要的list属性,Map<School,List<SchoolClass>>是二级需要的doubleList属性;
3.在页面上<s:action/>请求之后,表单中的<s:doubleselect >显示正常,一级二级联动正常,并能显示出正确的数据,说明标签的写法应该没有错误;
<s:doubleselect
name="schoolId"
list="#request.schools"
listKey="id"
listValue="schoolName"
doubleList="(#request.schoolClasses).get(top)"
doubleListKey="id"
doubleListValue="schoolClassName"
doubleName="schoolClassId"
headerKey="-1"
headerValue="-*-请选择学校-*-"
formName="create_customer"
></s:doubleselect>
4.在提交表单之后,到Action中里面的处理也都正常,里面两个Integer属性schoolId和schoolClassId都接收到了先前选的值;
5.执行成功后,回到create.jsp页面后就出现下面的错误提示:
Bypassing /customer/create
setting Value [schoolClassId=1]
setting Value [schoolId=1]
Validating /customer/create with method create.
Forwarding to location create.jsp
Bypassing /customer/school
Validating /customer/school with method execute.
Rendering template /template/simple/form
Rendering template /template/simple/form.ftl
Rendering template /template/simple/text
Rendering template /template/simple/text.ftl
Rendering template /template/simple/text
Rendering template /template/simple/text.ftl
Rendering template /template/simple/radiomap
Rendering template /template/simple/radiomap.ftl
Rendering template /template/simple/text
Rendering template /template/simple/text.ftl
Rendering template /template/simple/text
Rendering template /template/simple/text.ftl
Rendering template /template/simple/select
Rendering template /template/simple/select.ftl
Rendering template /template/simple/doubleselect
Rendering template /template/simple/doubleselect.ftl
Error on line 140, column 73 in template/simple/doubleselect.ftl
Expecting a string, date or number here, Expression parameters.doubleNameValue is instead a freemark
er.ext.beans.ArrayModel
The problematic instruction:
----------
==> ${parameters.doubleNameValue} [on line 140, column 71 in template/simple/doubleselect.ftl]
----------
Java backtrace for programmers:
----------
freemarker.core.NonStringException: Error on line 140, column 73 in template/simple/doubleselect.ftl
Expecting a string, date or number here, Expression parameters.doubleNameValue is instead a freemark
er.ext.beans.ArrayModel
有用的信息就这么多了,下面是大把的堆栈信息,看了一下,没啥用的,就只贴这些吧!
这个错误信息,我搜了蛮久的都没找到答案,看一看错误信息也知道到Freemarker的doubleselect.ftl模板中的哪个值不对了,蛋是,第一次遇见这问题,没啥头绪,不知从哪方面着手去解决,高手指点一下这信息啥意思?怎么去解决! 展开
2.<s:action/>标签请求了一个另外一个Action,获得一个List<School>和一个Map<School,List<SchoolClass>>存储在request中,List<School>是一级下拉框所需要的list属性,Map<School,List<SchoolClass>>是二级需要的doubleList属性;
3.在页面上<s:action/>请求之后,表单中的<s:doubleselect >显示正常,一级二级联动正常,并能显示出正确的数据,说明标签的写法应该没有错误;
<s:doubleselect
name="schoolId"
list="#request.schools"
listKey="id"
listValue="schoolName"
doubleList="(#request.schoolClasses).get(top)"
doubleListKey="id"
doubleListValue="schoolClassName"
doubleName="schoolClassId"
headerKey="-1"
headerValue="-*-请选择学校-*-"
formName="create_customer"
></s:doubleselect>
4.在提交表单之后,到Action中里面的处理也都正常,里面两个Integer属性schoolId和schoolClassId都接收到了先前选的值;
5.执行成功后,回到create.jsp页面后就出现下面的错误提示:
Bypassing /customer/create
setting Value [schoolClassId=1]
setting Value [schoolId=1]
Validating /customer/create with method create.
Forwarding to location create.jsp
Bypassing /customer/school
Validating /customer/school with method execute.
Rendering template /template/simple/form
Rendering template /template/simple/form.ftl
Rendering template /template/simple/text
Rendering template /template/simple/text.ftl
Rendering template /template/simple/text
Rendering template /template/simple/text.ftl
Rendering template /template/simple/radiomap
Rendering template /template/simple/radiomap.ftl
Rendering template /template/simple/text
Rendering template /template/simple/text.ftl
Rendering template /template/simple/text
Rendering template /template/simple/text.ftl
Rendering template /template/simple/select
Rendering template /template/simple/select.ftl
Rendering template /template/simple/doubleselect
Rendering template /template/simple/doubleselect.ftl
Error on line 140, column 73 in template/simple/doubleselect.ftl
Expecting a string, date or number here, Expression parameters.doubleNameValue is instead a freemark
er.ext.beans.ArrayModel
The problematic instruction:
----------
==> ${parameters.doubleNameValue} [on line 140, column 71 in template/simple/doubleselect.ftl]
----------
Java backtrace for programmers:
----------
freemarker.core.NonStringException: Error on line 140, column 73 in template/simple/doubleselect.ftl
Expecting a string, date or number here, Expression parameters.doubleNameValue is instead a freemark
er.ext.beans.ArrayModel
有用的信息就这么多了,下面是大把的堆栈信息,看了一下,没啥用的,就只贴这些吧!
这个错误信息,我搜了蛮久的都没找到答案,看一看错误信息也知道到Freemarker的doubleselect.ftl模板中的哪个值不对了,蛋是,第一次遇见这问题,没啥头绪,不知从哪方面着手去解决,高手指点一下这信息啥意思?怎么去解决! 展开
展开全部
虽然俺是学的计算机编程滚山颤 但是一看见这些代码 脑袋就晕 只能帮你顶顶 另外你倒数第二行的那个 蛋是 很有创意 和蛋定等词语有异曲同大败唯孙工之妙用
=========
厂家直销硒鼓 碳粉 实体店+双钻店铺 欢迎空间看更多联系
=========
厂家直销硒鼓 碳粉 实体店+双钻店铺 欢迎空间看更多联系
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询