gpt4 book ai didi

java - spring 在链接中使用安全 :authentication principal. 用户名

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:32:39 26 4
gpt4 key购买 nike

好的,这应该很简单

在 header.jspx 文件中,我希望有一个链接可以将经过身份验证的用户引导至他们的用户页面。

这是我用来检索用户名的方法:

<sec:authentication property="principal.username" /> 

这就是我要放入的内容:

<a href="http://localhost:8080/dealclick/users/username_here" > My account </a>

可以吗?

最佳答案

你试过吗

<c:set var="username">
<sec:authentication property="principal.username" />
</c:set>

然后使用

<a href="http://localhost:8080/dealclick/users/${username}" > My account </a>

关于java - spring 在链接中使用安全 :authentication principal. 用户名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8167935/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com