  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | -none- | -none- 2007-08-16 - By Dimitris Mouchritsas
Back Hi everyone. I'm testing this code:
<fmt:formatNumber type = "currency" groupingUsed = "true" > ${ table_data.package_price + ( road_assistance_2year == '-' ? 0.0 : road_assistance_2year ) + ( comp_offer_data.hasInsurance ? table_data.insuranceValue : 0.0 ) } </fmt:formatNumber>
and in Tomcat 6.0.13 it works fine. However in Tomcat 5.0.19 the page stops proccessing and and exception is thrown. Tomcat complains that he cannot convert String '-' to a java.lang.Double. I tried to change the code a little to this:
<c:choose> <c:when test = "${ road_assistance_2year == '-' }"> <c:set var = "road_assist_price" value = "0.0" /> </c:when> <c:otherwise> <c:set var = "road_assist_price" value = "${ road_assistance_2year }" /> </c:otherwise> </c:choose>
and later on just do ${ table_data.package_price + road_assist_price + insured_price } but I still get the same error. Why can't Tomcat just fail the test in when and is there a work around?
PS. Yes road_assistance_2year can either be a price, or a '-' indicating N/A.
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To start a new topic, e-mail: users@(protected) To unsubscribe, e-mail: users-unsubscribe@(protected) For additional commands, e-mail: users-help@(protected)
|
|
 |