Expression dqgrade is undefined on line 20, column 30------freemarker报这样的错怎么解决
Expression dqgrade is undefined on line 20, column 30 in WEB-INF/pages/dqgrade/updateDqgrade.html.
The problematic instruction:
----------
==> if dqgrade.id?exists [on line 20, column 25 in WEB-INF/pages/dqgrade/updateDqgrade.html]
----------
Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression dqgrade is undefined on line 20, column 30 in WEB-INF/pages/dqgrade/updateDqgrade.html.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
at freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.BuiltIn$existsBI._getAsTemplateModel(BuiltIn.java:636)
at freemarker.core.BuiltIn$existsBI.isTrue(BuiltIn.java:647)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:232)
同样的使用freemarker,我在一个页面中能正确使用,而在另一个页面去不行,报了这样的错,问大虾,是哪个文件有错误 了,MOdel?bean?service?action?还是其他?????急!!!!!
------解决方案-------------------- on line 20, column 30 in WEB-INF/pages/dqgrade/updateDqgrade.html弄出来看看
------解决方案--------------------freemarker处处需要判空,蛋疼。
<body style="text-align: center; background-image: url('images/bg2.gif')">
<br /><br /><br />
<h2>修改年级</h2>
<br /><br /><br />
<form method="post" id="form1" name="form1" action="doUpdateDqgrade.do">
<#if dqgrade??>
${dqgrade.id!}
</#if>
<input type="hidden" name="id" value="${dqgrade.id?if_exists}"/>
请输新的入年级号:
<input type="text" name="stugrade" value="${dqgrade.stugrade?if_exists}"/>
<input type="submit" value="修改年级信息" />
</form>
</body>
------解决方案--------------------上面提的代码是改了的,只是没标红而已。
<#if
dqgrade??>
${dqgrade.id!}
</#if>