Question

I know this could be a basic question but i have been stuck on this for hours. What i am trying to do is a comparing two dates in JSP and if the following equals each other do the follow.

    <%
        if(!viewBean.isHiddenEndDate())
        {
            (reportVO.getEndDate().getYear() == 9999 && reportVO.getEndDate().getMonth() == 12 && reportVO.getEndDate().getDate() == 31);
    %>
        <td headers="EndDate<%=localizationHelper.getContentString(reportVO.getLocalizedTypeLabel())%>">"Until terminated"</td>
    <%  }else{ %>
        <td headers="EndDate"><%=localizationHelper.formatDate(reportVO.getEndDate())%></td>
    <%
    }
    %>

However when i do this, mySyntax error, insert AssignmentOperator Expression to complete Assignment and Syntax error, insert ; to complete BlockStatements.

Thanks.

Was it helpful?

Solution

The compiler is expecting something like boolean flag = to the left of the line (reportVO.getEndDate().getYear() == 9999 && reportVO.getEndDate().getMonth() == 12 && reportVO.getEndDate().getDate() == 31); Hence the error about completing the Assignment Operator Expression.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top