I have a map userDetailsMap<String,List<String>>
available in my jsp.
And eligibleUser,notEligibleUser,enrolledUser
are the keys.
I can easily check for the key inside s:iterator
tag.
Like(This code is working) :
<s:iterator var="userDetailsMap" value="context.userDetails">
<s:if test="%{#userDetailsMap.key=='eligibleUser'}">
//some code
</s:if>
<s:if test="%{#userDetailsMap.key=='notEligibleUser'}">
//some code
</s:if>
<s:if test="%{#userDetailsMap.key=='enrolledUser'}">
//some code
</s:if>
</s:iterator>
But how I check that a particular key is present or not? I have used :
1.
<s:if test="%{#userDetailsMap['eligibleUser'] == null}">
//some code
</s:if>
2.
<s:if test="%{#userDetailsMap.containsKey('eligibleUser')}">
//some code
</s:if>
But both of them didn't work.
Please suggest me.