Re: Error message

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Tuesday, September 6, 2011, 11:38:11 AM, Shervin Asgari wrote:

> On 09/05/2011 05:15 PM, Daniel Dekany wrote:
>>
>> That's strange. The error message states that you refer to a variable
>> called "any" that is either null or it just doesn't exist. But the
>> quoted expression doesn't refer to "any", plus the quoted line is said
>> to be on line 4 (as opposed to line 2) and column 6079 (that's a long
>> line). It's like if the error is originated from another line than
>> what's stated. Maybe you have the #escape on line 2 column 17? Anyway
>> that still doesn't explain the "any" thing. What happens if you delete
>> everything from the file and only leave
>> ${motorferdsel.applicant.epost} there?
> Well everything was on one line, I auto formated it so it was more 
> readable.
> That is strange. I don't have a variable called any.

That's certainly some bug around constructing the error message. But
the type of the error (undefined var) is certainly still right.

> I will try only the ${motorferdsel.applicant.epost} part and see what 
> happens.
> The error message was just a snippet. There are tons more with the same
> stuff. Some keys work, some don't. Which is pretty strange.
>
>> That the value of mfapproval is a String, so you can't use it with the
>> "." operator. (Would be useful if it just says that...)
>>
> Actually the mfapproval is a Enum which has a variable called created 
> which is Date. But perhaps enums are not supported?

It's supported, and assuming you have a `public Date getCreated()` in
a public Enum subclass, something like ${someEnum.created?datetime}
should work. I suspect that somewhere that Enum was converted to
java.lang.String. Otherwise the reported type wouldn't be
SimpleScalar. (Actually, wrapped Enum-s are FTL string-s, however they
are StringModel-s, not SimpleScalar-s, and StringModel-s can have
subvariables.)

> Shervin

-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
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.