One of the most amazing features of Netbeans is code generation using some FreeMarker templates. I have some questions about this, I hope someone here can help me.
How can I create a template on Netbeans that generates more than just one file?
For example, I use the "JSF Pages From Entity Beans" wizard to create CRUD files . Therefore, it automatically creates 4 files for every object that I have:
- Create.xhtml - Edit.xhtml - List.xhtml - View.xhtml
This is very useful because you often need to create, edit, view or view some records from your database. Therefore, I know that I can edit each template separately by clicking Tools β Templates β JavaServer Faces β JSF Entity β View.xhtml . And then I can change the way of creating View.xhtml . Then the FTL file is created in "C: \ Users \ yourname \ .netbeans \ 6.9 \ config \ Templates \ JSF \ JSF_From_Entity_Wizard \ view.ftl" .
But I need more, I need a search page. My question is how can I create or modify a template, for example "JSF Pages From Entity Beans", which generates not only 1 file, but also 4 for each object. Therefore, I can modify this template to generate 5 files:
- Create.xhtml - Edit.xhtml - List.xhtml - View.xhtml - Search.xhtml (for example)
Thanks in advance!
source share