srihari_ravi
2013-05-24 13:08:04 UTC
I have read the current documentation on custom directives.
My basic doubt is: how does freemarker link between a custom directive class
(that implements the TemplateDirectiveModel interface) and the custom
directive I want to use in my template? Lets say that I want to create a
directive that creates a file with the custom directive's body. I want to
call this directive @file and I create a corresponding FileDirective class
implementing the interface. How does freemarker understand that this is the
class implementation for @file?
I currently get an error like below. Thanks in advance for helping!
- Ravi.
[javadoc] May 24, 2013 2:53:20 PM
freemarker.log.JDK14LoggerFactory$JDK14Logger error
[javadoc] SEVERE: Template processing error: "on line 14, column 1 in
ErrorDoc_Modules.ftl file not found."
[javadoc]
[javadoc] on line 14, column 1 in ErrorDoc_Modules.ftl file not found.
[javadoc] The problematic instruction:
[javadoc] ----------
[javadoc] ==> *user-directive file* [on line 14, column 1 in
ErrorDoc_Modules.ftl]
[javadoc] ----------
[javadoc]
[javadoc] Java backtrace for programmers:
[javadoc] ----------
[javadoc] freemarker.core.InvalidReferenceException: on line 14, column 1
in ErrorDoc_Modules.ftl file not found.
[javadoc] at freemarker.core.UnifiedCall.accept(UnifiedCall.java:134)
[javadoc] at freemarker.core.Environment.visit(Environment.java:221)
[javadoc] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[javadoc] at freemarker.core.Environment.visit(Environment.java:221)
[javadoc] at freemarker.core.Environment.process(Environment.java:199)
[javadoc] at freemarker.template.Template.process(Template.java:259)
[javadoc] at
com.splwg.oms.doc.ErrorDocumentDoclet2.freemarkerDo(ErrorDocumentDoclet2.java:267)
[javadoc] at
com.splwg.oms.doc.ErrorDocumentDoclet2.createOutputFiles(ErrorDocumentDoclet2.java:249)
[javadoc] at
com.splwg.oms.doc.ErrorDocumentDoclet2.createPortalFiles(ErrorDocumentDoclet2.java:119)
[javadoc] at
com.splwg.oms.doc.ErrorDocumentDoclet2.start(ErrorDocumentDoclet2.java:86)
[javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[javadoc] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[javadoc] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:601)
[javadoc] at
com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:280)
[javadoc] at
com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:160)
[javadoc] at
com.sun.tools.javadoc.Start.parseAndExecute(Start.java:397)
[javadoc] at com.sun.tools.javadoc.Start.begin(Start.java:167)
[javadoc] at com.sun.tools.javadoc.Main.execute(Main.java:59)
[javadoc] at com.sun.tools.javadoc.Main.main(Main.java:49)
--
View this message in context: http://freemarker.624813.n4.nabble.com/Custom-directive-in-template-not-identified-by-freemarker-tp4654555.html
Sent from the freemarker-user mailing list archive at Nabble.com.
My basic doubt is: how does freemarker link between a custom directive class
(that implements the TemplateDirectiveModel interface) and the custom
directive I want to use in my template? Lets say that I want to create a
directive that creates a file with the custom directive's body. I want to
call this directive @file and I create a corresponding FileDirective class
implementing the interface. How does freemarker understand that this is the
class implementation for @file?
I currently get an error like below. Thanks in advance for helping!
- Ravi.
[javadoc] May 24, 2013 2:53:20 PM
freemarker.log.JDK14LoggerFactory$JDK14Logger error
[javadoc] SEVERE: Template processing error: "on line 14, column 1 in
ErrorDoc_Modules.ftl file not found."
[javadoc]
[javadoc] on line 14, column 1 in ErrorDoc_Modules.ftl file not found.
[javadoc] The problematic instruction:
[javadoc] ----------
[javadoc] ==> *user-directive file* [on line 14, column 1 in
ErrorDoc_Modules.ftl]
[javadoc] ----------
[javadoc]
[javadoc] Java backtrace for programmers:
[javadoc] ----------
[javadoc] freemarker.core.InvalidReferenceException: on line 14, column 1
in ErrorDoc_Modules.ftl file not found.
[javadoc] at freemarker.core.UnifiedCall.accept(UnifiedCall.java:134)
[javadoc] at freemarker.core.Environment.visit(Environment.java:221)
[javadoc] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[javadoc] at freemarker.core.Environment.visit(Environment.java:221)
[javadoc] at freemarker.core.Environment.process(Environment.java:199)
[javadoc] at freemarker.template.Template.process(Template.java:259)
[javadoc] at
com.splwg.oms.doc.ErrorDocumentDoclet2.freemarkerDo(ErrorDocumentDoclet2.java:267)
[javadoc] at
com.splwg.oms.doc.ErrorDocumentDoclet2.createOutputFiles(ErrorDocumentDoclet2.java:249)
[javadoc] at
com.splwg.oms.doc.ErrorDocumentDoclet2.createPortalFiles(ErrorDocumentDoclet2.java:119)
[javadoc] at
com.splwg.oms.doc.ErrorDocumentDoclet2.start(ErrorDocumentDoclet2.java:86)
[javadoc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[javadoc] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[javadoc] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javadoc] at java.lang.reflect.Method.invoke(Method.java:601)
[javadoc] at
com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:280)
[javadoc] at
com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:160)
[javadoc] at
com.sun.tools.javadoc.Start.parseAndExecute(Start.java:397)
[javadoc] at com.sun.tools.javadoc.Start.begin(Start.java:167)
[javadoc] at com.sun.tools.javadoc.Main.execute(Main.java:59)
[javadoc] at com.sun.tools.javadoc.Main.main(Main.java:49)
--
View this message in context: http://freemarker.624813.n4.nabble.com/Custom-directive-in-template-not-identified-by-freemarker-tp4654555.html
Sent from the freemarker-user mailing list archive at Nabble.com.