我的jsp页面有问题。我使用Spring安全性,我需要获得一个authentificated用户的名称,为此我使用下一个标签
<security:authentication property="name" />
我需要将此值与其他String进行比较,我该怎么做? 我以为我可以将此值设置为某些参数,如
<c:set var="userName" value="<security:authentication property='name'/>"scope="page" />
然后比较我的值
<c:when test="${(params.userSelect.login eq pageScope.userName)}">
但这不起作用。我从<security:authentication property="name" />
获得了名称(我可以在jsp页面上查看),但我无法比较这些值。
答案 0 :(得分:4)
c:set可以将body的内容作为值。
<c:set var="userName"><security:authentication property="name" /></c:set>