【发布时间】:2015-02-14 12:37:48
【问题描述】:
我想知道是否有可能构建 url。
我用什么:
- 弹簧靴 + 弹簧安全
- 百里香
通过下面的表达式,我得到了用户名
sec:authentication="name"
如果我执行以下操作,将显示当前用户名
<span id="userName" sec:authentication="name">Testuser</span>
但现在我想构建一个如下所示的网址:
<a th:href="@{'~/' + __${{sec.authentication='name'}}__ + '/edit'}" class="text-left">Settings</a>
这样我得到以下错误:
org.springframework.expression.spel.SpelEvaluationException: EL1009E:(pos 4): Property or field 'authentication' cannot be set on null
有什么建议吗?
提前致谢。
【问题讨论】:
标签: spring spring-security thymeleaf