OGNL in struts2: and



Access value form <s:iterator> into <s:if> (ognl with <s:if> and <s:iterator>)

For example: Suppose loadUserList is the itertaor(containing UserName and Address ) to be iterate on jsp,

<s:if test="loadUserList != null && loadUserList.isEmpty()">
  <s:iterator value="loadUserWalksResults" status="rowStatus">


                 UserName:<s:property escape="false" value="userName" />
Address:<s:property escape="false" value="address" />
<s:if test='userName.equals("Admin")'>This is admin User</s:if>
<s:else>This is not an admin user!</s:else>
  </s:iterator>
</s:if>

Comments

Popular posts from this blog

Struts 2 : Warning :No configuration found for the specified action: 'Login.action' in namespace: '/'

Upload csv file at Google Cloud Storage using java

Read Images from a xlsx file using Apache POI