I am using Struts2. And having trouble checking String for null or empty. The row is in a loop.
What I have done so far
in the Action class, I have a List<User> . User have id and name fields and getters and setters ...
in jsp i do as
<s:iterator value="userList" var="user" status="userStatus"> <s:if test"%{user.name != null && user.name != ''}"> ${user.name} </s:if> </s:iterator>
The problem is that it does not work :(, I cannot see the names, and they are visible if I delete the <s:if> block.
Talha Ahmed Khan
source share