赞
踩
错误org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: “class path resource [templates/login/main.html]”)
Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: “sub.url” (template: “login/main” - line 38, col 32)
Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: “sub.url” (template: “login/main” - line 38, col 32)
2021-04-17 08:24:17.012 ERROR 4572 — [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: “class path resource [templates/login/main.html]”)] with root cause
HTML代码:
<dl class="layui-nav-child" th:if="${resource.subs} ne null " th:each="sub:${resource.subs}">
<dd><a th:href="'javascript:showTab(\''+${sub.url}+'\',\'' +${sub.resourceName}+'\',' + ${sub.resourceId} +');'" th:text="${sub.resourceName}">列表一</a></dd>
</dl>
<script th:src="@{/webjars/layui/layui.all.js}"></script>
<script th:src="@{/webjars/jquery/jquery.js}"></script>
<script th:src="@{/static/js/login/main.js}"></script>
js
function showTab(url,name,id){ let length = $("li[lay-id="+id+"]").length; let element = layui.element; if (length == 0) { let fullUrl = "/" + url; let height = $(window).height() - 185; let content = '<iframe style="width: 100%;height: '+height+'px" src="' +fullUrl+'" frameborder="0" scrolling="no">' element.tabAdd('menu', { title: name, content: content, id: id }); } element.tabChange("menu", id); }
后台是没有URL的实体属性的。。。。。
解决:尚未解决
更新:需要在后台加入URL的实体属性。。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。