Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Compare java.math.BigDecimal values in JSTL

User_19BPUJan 6 2011 — edited Jan 9 2011
Hi,

I have 2 amounts , amt1 and amt2 which are java.math.BigDecimal, where i need to compare these amounts using JSTL in JSP , I have tried with both <c:when> and <c:if>

like

<c:if test="${! MyVO.amt1 == MyVO.amt2}"> or <c:if test="${! MyVO.amt1.compareTo(MyVO.amt2) == 0}">

// do this
</c:if>
<c:if test="${ MyVO.amt1 == MyVO.amt2}"> // else

// do this
</c:if>

It is giving me an error saying Cannot convert class java.math.BigDecimal to class java.lang.Boolean? How to overcome this problem?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 6 2011
Added on Jan 6 2011
1 comment
4,069 views