Re: Dealing with reserved names
Daniel Dekany <[email protected]> Thu, 1 Jun 2006 19:53:23 +0200
| Newsgroups | gmane.comp.text.fmpp |
|---|---|
| Message-ID | <[email protected]> |
Thursday, June 1, 2006, 3:01:44 PM, Bruce Perryman wrote:
> Thanks for responding.
>
> It's a nested Map populated in java from a db resultset. One of the
> keys' name is 'default'. When I evaluate it, it is always empty
> (""). If the name is something other than 'default', I retrieve the
> value of the key. I'm assuming that the problem is that FreeMarker
> is confused by the reserved name 'default'.
That name is not reserved in FreeMarker. (It's used like
foo?default('-'), but the possible words after the ? are specified by
the template language, so it's not like reserving them.)
> If that is true, renaming the key name would be a project. I was
> wondering if FreeMarker could somehow 'escape' the name 'default' so
> that I can retrieve the value associated with that key.
FreeMarker doesn't reserve any map keys. But to be sure that there is
no bug with the "default" key, I tried that and it works for me. I
guess the problem is rather with the data source that you use to read
the database. Or maybe simply the SQL statement is wrong.
> Thanks.
--
Best regards,
Daniel Dekany