I want to represent the following JSTL code in Object Graph Navigation Language (OGNL).
<c:set var="idError"><s:fielderror fieldName="transporterId"/></c:set>
<c:set var="chkError"><s:fielderror fieldName="chk"/></c:set>
<c:set var="currentPageError"><s:fielderror fieldName="currentPage"/></c:set>
<c:if test="${not empty idError or not empty chkError or not empty currentPageError}">
<div class="errorblock">
<s:fielderror fieldName="transporterId"/>
<s:fielderror fieldName="chk"/>
<s:fielderror fieldName="currentPage"/>
</div>
</c:if>
I have tried the following.
<s:set var="idError"><s:fielderror fieldName="transporterId"/></s:set>
<s:set var="chkError"><s:fielderror fieldName="chk"/></s:set>
<s:set var="currentPageError"><s:fielderror fieldName="currentPage"/></s:set>
<s:if test="%{(#idError!=null and #idError!='') or (#chkError!=null and #chkError!='') or (#currentPageError!=null and #currentPageError!='')}">
<div class="errorblock">
<s:fielderror fieldName="transporterId"/>
<s:fielderror fieldName="chk"/>
<s:fielderror fieldName="currentPage"/>
</div>
</s:if>
This works only for the first conditional check, #idError!=null and #idError!=''
. The rest of the conditions are never evaluated to true?
What is the correct way to represent the given JSTL code using OGNL?