在做hibernate和struts2的整合项目的过程中
写了一个有关doubleselect标签的Demo
出现了如下报错:
严重: Servlet.service() for servlet jsp threw exception
Expression parameters.formName is undefined on line 150, column 43 in template/simple/doubleselect.ftl.
The problematic instruction:
----------
==> ${parameters.formName} [on line 150, column 41 in template/simple/doubleselect.ftl]
in include "/${parameters.templateDir}/simple/doubleselect.ftl" [on line 25, column 1 in template/xhtml/doubleselect.ftl]
----------
Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression parameters.formName is undefined on line 150, column 43 in template/simple/doubleselect.ftl.
错误原因:本来就想写个简单的demo,在jsp中就只写了doubleselect,之后报了以上错误。
有一下几点需要注意:
- 需要在页面中用s:form标签将doubleselect包绕
- 注意要填写 s:form中的name值
- 注意form是struts中的
<s:form>
,普通的html<form>
同样报错