[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3754
  • Last Modified:

Struts/EL tags: How to check boolean/Boolean ?

I have the following code in JSP template:
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<jsp:useBean id="bean" scope="page" class="com.test.struts.form.LoginForm"/>
...
        <logic:equal name="bean" property="forgotPassword" value="new Boolean(true)">
            <br><a  style="color: white !important" href="jsp/login/ForgotPassword.jsp"><sub><%=I18n.getString("MSG_FORGOT_PASSWORD")%></sub></a>
        </logic:equal>

where forgotPassword defined as

    Boolean forgotPassword;

    public Boolean getForgotPassword() {
        return forgotPassword;
    }

    public void setForgotPassword(Boolean forgotPassword) {
        this.forgotPassword = forgotPassword;
    }

When I've checked it using <%=System.out.println(bean.getForgotPassword()%> - I got true, but never seen code within logic tag.

Tried the same thing using JSTL:
<core:if test="${bean.forgotPassword}">
</core:if>
also don't work.

Tried boolean instead of Boolean - the same problem.


0
maximkr
Asked:
maximkr
1 Solution
 
TimYatesCommented:
Does:

<logic:equal name="bean" property="forgotPassword" value="true">

work?
0
 
maximkrAuthor Commented:
Yes, the problem was in another place, my bug
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now