0

当我在 IE10 桌面上打开这个网站时,它显示 Freemarker 错误堆栈。

Error: on line 18, column 32 in WEB-INF/ftl/common/requestVariables.ftl
Expecting a number here, found: .
The problematic instruction:
----------
==> browserMinor=applicationBean.browser.browserMinor?number [on line 18, column 17 in WEB-INF/ftl/common/requestVariables.ftl]
 in include "/WEB-INF/ftl/common/requestVariables.ftl" [on line 12, column 1 in WEB-INF/ftl/login/login.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.NonNumericalException: Error: on line 18, column 32 in WEB-INF/ftl/common/requestVariables.ftl
Expecting a number here, found: .
    at freemarker.core.StringBuiltins$numberBI.calculateResult(StringBuiltins.java:186)
    at freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71)
    at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
    at freemarker.core.Assignment.accept(Assignment.java:90)
    at freemarker.core.Environment.visit(Environment.java:196)
    at freemarker.core.AssignmentInstruction.accept(AssignmentInstruction.java:86)
    at freemarker.core.Environment.visit(Environment.java:196)
    at freemarker.core.MixedContent.accept(MixedContent.java:92)
    at freemarker.core.Environment.visit(Environment.java:196)

如果我更改连接字符串(F12 developer tools, press Tools > Change user-agen string > Mozilla Firefox),它工作得很好。

是因为框架中的浏览器嗅探吗?

4

1 回答 1

0

似乎Web应用程序框架(不是FreeMarker)将browserMinor设置""为IE10,这当然不是一个数字。要么它应该在此处输入“0”,要么必须修改 requestVariables.ftl 以处理这种情况。

于 2012-10-18T08:30:33.543 回答