Re: No other way of handling missing values?
Andy <[email protected]> Fri, 13 Feb 2015 20:35:46 +0800
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <CANkHR=ROmsmXf_cX2JMk=hsqHbh243TUEwNAhOxpWAqykQNHPQ@mail.gmail.com> |
--===============3575209077888477173== Content-Type: multipart/alternative; boundary=047d7b414a88c48521050ef7797a --047d7b414a88c48521050ef7797a Content-Type: text/plain; charset=UTF-8 probably this still works: <#if (((c.royaltyTerms.OffsetLimit.perProductYn)!"N")=="Y")> On Fri, Feb 13, 2015 at 8:16 PM, tim <[email protected]> wrote: > I am checking on a flag that sometimes is missing/NULL and sometimes it > exists in the model but is false. > > The only way to securely check on the flag I found is: > > <#if (c.royaltyTerms.OffsetLimit.perProductYn)??> (see if it is NULL) > <#if (c.royaltyTerms.OffsetLimit.perProductYn=="Y")> (see if is true/set) > > Is there no better way? I appreciate the possibility of differentiating > between NULL and existing, but it is only very rare cases in which such a > check is required. In 90% of the cases you want a missing value be treated > as an existing but not matching value... In the freemarker docs it says > that > Freemarker is picky about NULL values in its standard configuration. But I > found no configuration to change this behavior. Is there any? > > Cheers, > Tim --047d7b414a88c48521050ef7797a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>probably this still works:</div><div><br></div><#i= f (((c.royaltyTerms.OffsetLimit.perProductYn)!"N")=3D=3D"Y&q= uot;)><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On F= ri, Feb 13, 2015 at 8:16 PM, tim <span dir=3D"ltr"><<a href=3D"mailto:t.= [email protected]" target=3D"_blank">[email protected]</a>></s= pan> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0p= x 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-lef= t-style:solid;padding-left:1ex">I am checking on a flag that sometimes is m= issing/NULL and sometimes it<br> exists in the model but is false.<br> <br> The only way to securely check on the flag I found is:<br> <br> <#if (c.royaltyTerms.OffsetLimit.perProductYn)??> (see if it is NULL)= <br> <#if (c.royaltyTerms.OffsetLimit.perProductYn=3D=3D"Y")> (s= ee if is true/set)<br> <br> Is there no better way? I appreciate the possibility of differentiating<br> between NULL and existing, but it is only very rare cases in which such a<b= r> check is required. In 90% of the cases you want a missing value be treated<= br> as an existing but not matching value... In the freemarker docs it says tha= t<br> Freemarker is picky about NULL values in its standard configuration. But I<= br> found no configuration to change this behavior. Is there any?<br> <br> Cheers,<br> Tim</blockquote></div></div></div> --047d7b414a88c48521050ef7797a-- --===============3575209077888477173== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ --===============3575209077888477173== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ FreeMarker-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freemarker-user --===============3575209077888477173==--