当我在IE10桌面上打开this website时,会显示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)
,则效果很好。
是否是由于框架中的浏览器嗅探?
答案 0 :(得分:0)
似乎Web应用程序框架(不是FreeMarker)为IE10设置了browserMinor到""
,这当然不是一个数字。它应该在这里放“0”,或者必须修改requestVariables.ftl来处理这种情况。