开发者

How to set value from<security:authentication/> to the parameter with <c:set>

I have a problem in my jsp page. I use Spring security and I need to get a name of the authentificated user, for this I use the next tag

 <security:authentication property="name" />

I need to compare this value with other String, how can I do this? I thought I can set this value to some parameter like

<c:set var="userName" value="<security:authentication property='name'/>"scope="page" /&g开发者_JS百科t;

and then to compare my values

<c:when test="${(params.userSelect.login eq pageScope.userName)}">

but this doesn't work. I get the name from <security:authentication property="name" /> (I can view it on jsp page), but I can't compare this values.


c:set can take the content of the body in as the value.

<c:set var="userName"><security:authentication property="name" /></c:set>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜