A couple of quick tips related to best practices:
1. to include another FTL file it is usually better to have a screen that
renders the FTL file and prepares its data all in one (more modular), and then
just include the screen from the first FTL file
2. when using the ofbizUrl tag/transform put the arguments inside the
tag/transform with the request-map uri
-David
rakesh verma wrote:
Hi Scott,
Thanks for the response.
I want to add one thing. main1.ftl and main2.ftl are in the same
folder.We are getting the error when we are trying to access the ftl
through Widgets. main2.ftl is inside the main1.ftl.
This same code is working fine in ofbiz5028 which we were using
previously but it is not working with ofbiz we checked out from
https://svn.apache.org/repos/asf/ofbiz/branches/release4.0.
I want to add one more thing this error is occuring in ecommerce
application too .when we are providing the following url
https://localhost:8443/ecommerce/control/showforum;jsessionid=E0D21A22BF35555796A937B22F7B6D0E.jvm1?forumId=ASK
.
Does we need to make some changes any where?
Thanks in advace.
Regards,
Rakesh
On 6/21/07, Scott Gray <[EMAIL PROTECTED]> wrote:
Hi Rakesh
The log seems pretty self explanatory:
java.io.FileNotFoundException: Template main2.ftl not found.
Regards
Scott
On 21/06/07, rakesh verma <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> Previously we were using Ofbiz5028 and now we are using new version of
> ofbiz that is from release 4.0.
>
> After deploying the previous code we found that <# include "main.ftl>
> is not working.
>
> We are getting the following error.
>
> Error reading included file main2.ftl The problematic instruction:
> ---------- ==> include "main2.ftl" [on line 10, column 9 in main.ftl]
> ---------- Java backtrace for programmers: ----------
> freemarker.template.TemplateException: Error reading included file
> main2.ftl at freemarker.core.Include.accept(Include.java:153) at
> freemarker.core.Environment.visit(Environment.java:196) at
> freemarker.core.MixedContent.accept(MixedContent.java:92) at
> freemarker.core.Environment.visit(Environment.java:196) at
> freemarker.core.Environment.process(Environment.java:176) at
> freemarker.template.Template.process(Template.java:232) at
> org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation(
> FreeMarkerWorker.java:179)
> at
org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java
> :77)
> at org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString(
> HtmlWidget.java:105)
> at
org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java
> :64)
> at
>
org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString
> (ModelScreenWidget.java:807)
> at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(
> ModelScreenWidget.java:152)
> at
org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(
> ModelScreenWidget.java:245)
> at
org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java
> :134)
> at
org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:105)
> at
org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:90)
> at org.ofbiz.widget.screen.ScreenWidgetViewHandler.render(
> ScreenWidgetViewHandler.java:78)
> at
org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java
> :642)
> at
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java
> :426)
> at
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:189)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:595) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:688) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:252)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
> at
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:248)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:202)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
> at org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:213)
> at org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:178)
> at org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:126)
> at org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:105)
> at org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:107)
> at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java
> :541)
> at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :148)
> at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
> :869)
> at
>
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:664)
> at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> PoolTcpEndpoint.java:527)
> at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
> at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
> at java.lang.Thread.run(Thread.java:536) Caused by:
> java.io.FileNotFoundException: Template main2.ftl not found. at
> freemarker.template.Configuration.getTemplate(Configuration.java:489)
> at freemarker.core.Environment.getTemplateForInclusion(Environment.java
> :1357)
> at freemarker.core.Include.accept(Include.java:143) ... 39 more
>
>
> Please guide us.
>
> Thanks in advance
>
>
> Regards
>
> Rakesh
>