评估字符串阵列的弹簧表达式的异常
而在Spring Boot< = 2.4.3以下摘要工作正常。
<div class="link-red ddmenu" th:with="urls=${new String[]{'/'}}"
th:classappend="${#arrays.contains(urls, #httpServletRequest.getRequestURI()) ? 'selected' : ''}">
<a href="/" th:href="@{/}"> <i class="fa fas fa-home"></i>Home
</a>
</div>
但是在升级到2.7.0之后,我得到了这个解析例外。我该怎么办?
Exception evaluating SpringEL expression: "new String[]{'/'}"
还是此休息时间的任何相关信息,可在任何百里美的官方网站上可用?
While at spring boot <= 2.4.3 the below snippet worked fine.
<div class="link-red ddmenu" th:with="urls=${new String[]{'/'}}"
th:classappend="${#arrays.contains(urls, #httpServletRequest.getRequestURI()) ? 'selected' : ''}">
<a href="/" th:href="@{/}"> <i class="fa fas fa-home"></i>Home
</a>
</div>
But after upgrading to 2.7.0, I am getting this parsing exception. What should I do to fix it?
Exception evaluating SpringEL expression: "new String[]{'/'}"
Or any related information for this break, available on any Thymeleaf's official site?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有趣的是,如果您不断向下看堆栈轨道,您会在底部发现此错误:
如果我将表达式更改为:
一切都对我有效(用Spring Boot Starter 2.6.7进行了测试)。
Interestingly enough, if you keep looking down the stack track you find this error at the bottom:
If I change the expression to:
Everything works again for me (tested with Spring Boot starter 2.6.7).