Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Freemarker question

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class Field should be public, which means it needs to be in its own source file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic