IT Certificaions

Google Cloud Platform

Tuesday, January 17, 2012

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>