tags:

views:

220

answers:

1

What's a possible way to use Spring Security tag <sec:authentication property="principal.id" /> as the value for the <c:set…> tag?

These statements:

<c:set var="userId" value="<sec:authentication property='principal.id' />"/>
<c:set var="userId" value="<sec:authentication property=\"principal.id\" />"/>

won't work.

+3  A: 

There is no reason to use «value» attribute in your case. Use <c:set> tag in this way:

<c:set var="userId">
    <sec:authentication property="principal.id"/>
</c:set>
Little Jeans
good first answer :)
skaffman
@Little Jeans Thank you, it works!
Bar