This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Freemarker question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Freemarker question " Watch "Freemarker question " New topic
Author

Freemarker question

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
I have a question about Freemarker, not sure this is right place to post....

I try to use Freemarker to do a code generation. I am a new to this. Here is the coding, but it doesn't work, it complains

freemarker.core.InvalidReferenceException: Expression fld.name is undefined on line 3, column 19 in src/example.ftl.

Could you please tell me the reason ?

Here is the java code and template file.

BTW, as a software engineer, which is better tool to write code generation ?

Thanks.




////////////// code //////////

////////////////// FTL template ////////////





Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Edward Chen wrote:I have a question about Freemarker, not sure this is right place to post....

It isn't. I've moved this to a more appropriate location.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
The class Field should be public, which means it needs to be in its own source file.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Freemarker question
 
Similar Threads
problem using s:action tag
Mapping to an xml typed column (PostgreSQL) on an EJB3 entity in JBoss 5.1
Velocity question
How can i sort an array or list using comparable interface?
iterate problem in struts2