Java 百里香叶+;弹簧安全性->#身份验证在链接位置与其他位置组合时不起作用
我试图在链接(Java 百里香叶+;弹簧安全性->#身份验证在链接位置与其他位置组合时不起作用,java,spring,spring-security,thymeleaf,Java,Spring,Spring Security,Thymeleaf,我试图在链接(@{})中使用符号${{{#authentication.systemUser.tenant.url})。当我尝试在文本位置(${})中执行相同操作时,这种用法对我有效 我的代码: <strong th:text="${#authentication.systemUser.name}" /> <a th:href="@{/${#authentication.systemUser.tenant.url}/user}" > <i class="
@{}
)中使用符号${{{#authentication.systemUser.tenant.url}
)。当我尝试在文本位置(${}
)中执行相同操作时,这种用法对我有效
我的代码:
<strong th:text="${#authentication.systemUser.name}" />
<a th:href="@{/${#authentication.systemUser.tenant.url}/user}" >
<i class="fa fa-tachometer"></i>
<span th:text="#{user.dashboard}" />
</a>
文本位置:
<strong th:text="${#authentication.systemUser.name}" />
<a th:href="@{/${#authentication.systemUser.tenant.url}/user}" >
<i class="fa fa-tachometer"></i>
<span th:text="#{user.dashboard}" />
</a>
在本例中,我在DIV中声明了所有变量,然后在link中使用它
现在生成的链接是:
http://localhost:8080/apolo/user
我认为问题与使用
变量表达式
您可以使用管道|
执行文字替换()