简体   繁体   English

如何使用Struts 2检查List是否包含特定元素为null <s:if> 标签?

[英]How to check List contains the particular element null or not in Struts 2 using <s:if> Tags?

I have an action in Struts 2, I want to test whether email ID is empty or null using <s:if> test condition in JSP. 我在Struts 2中有一个操作,我想使用JSP中的<s:if>测试条件来测试电子邮件ID是空还是null

class EmailAction extends ActionSupport  {
      private ArrayList<Email> emailList;
      //setter and getters
}

class Email   {
     private String username;
     Private String password;
     private String emailId;
     //getters and setters
}

您应该为emailId提供getter

<s:if test="emailId == null || emailId == ''">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM