Re: Passing null values in java method

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Saturday, April 11, 2009, 1:39:02 PM, Divesh Dutta wrote:
> Hello all,
>          How to pass null value to a java method in ftl? Actually I
> am calling a java method in ftl and passed null value for one of the parameter. For eg:
>
> <#assign shippingEst =
> Static["org.ofbiz.order.shoppingcart.shipping.ShippingEvents"].getShipGroupEstimate(dispatcher, delegator, "SALES_ORDER",
>                         shippingMethodTypeId, carrierPartyId,
> carrierRoleTypeId, shippingCmId, productStoreId,
>                         null,shippableItemInfo,shippableWeight,
> shippableQuantity, shippableTotal, partyId, productStoreShipMethId)>

Provided that there was no value assigned to a variable called "null"
this it how you should do it. (Unfortunately null is only a keywords
starting from FM 2.4, but as far as there is no variable with name
"null", it acts like null.)

> But in Java :
> This method is not treating null as a null value . Here is the schema of this method:
>  public static Map getShipGroupEstimate(LocalDispatcher dispatcher,
> GenericDelegator delegator, String orderTypeId,
>             String shipmentMethodTypeId, String carrierPartyId,
> String carrierRoleTypeId, String shippingContactMechId,
>             String productStoreId, String supplierPartyId, List
> itemInfo, BigDecimal shippableWeight, BigDecimal shippableQuantity,
>             BigDecimal shippableTotal, String partyId, String productStoreShipMethId)

Exactly what value the method gets as the supplierPartyId if not null,
or what happens here?

> Please help.
>
> Thanks in advance
> Divesh
-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.