Question

I need to copy the username of current user into a variable to be able to compare it with another variable.

I retrieve the username using

<sec:authentication property="name"/>

Now need to copy it into a variable to be tested in following if condition

<c:if test="${(name eq myuser.username)}">
     .........
Was it helpful?

Solution

I got it I should use the following

  <sec:authentication var="currentUsername" property="name"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top