You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by BrettS <br...@gmail.com> on 2010/04/23 01:11:06 UTC

Re: How To Use JSP Custom Tag Within Freemarker Template Page?

Hi,

I am *still* failing to get a JSP tag working in an FTL file. Since last
time, I have added the following to web.xml.
(so I am using the stock freemarker.ext.servlet.FreemarkerServlet)
----------------------------------------
<servlet>
  <servlet-name>freemarker</servlet-name>
  <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
	
  <!-- FreemarkerServlet settings: -->
  <init-param>
	<param-name>TemplatePath</param-name>
	<param-value>/</param-value>
  </init-param>
  <init-param>
	<param-name>NoCache</param-name>
	<param-value>true</param-value>
  </init-param>
  <init-param>
	<param-name>ContentType</param-name>
	<param-value>text/html; charset=UTF-8</param-value> <!-- Forces UTF-8
output encoding! -->
  </init-param>
	
  <!-- FreeMarker settings: -->
  <init-param>
	<param-name>template_update_delay</param-name>
	<param-value>0</param-value> <!-- 0 is for development only! Use higher
value otherwise. -->
  </init-param>
  <init-param>
	<param-name>default_encoding</param-name>
	<param-value>ISO-8859-1</param-value> <!-- The encoding of the template
files. -->
  </init-param>
  <init-param>
	<param-name>number_format</param-name>
	<param-value>0.##########</param-value>
  </init-param>

  <load-on-startup>3</load-on-startup>
</servlet>


<servlet-mapping>
  <servlet-name>freemarker</servlet-name>
  <url-pattern>*.ftl</url-pattern>
</servlet-mapping> 
----------------------------------------

However, when I attempt the following in Freemarker: 
<#assign imps=JspTaglibs["/WEB-INF/imps.tld"]> 
<@imps.xhtmldoctype request=request /> 

I still get this message:
"Could not find an instance of
freemarker.ext.servlet.ServletContextHashModel in the data model under
either the name __FreeMarkerServlet.Application__ or Application"

Any suggestions?

Regards

Brett S

-- 
View this message in context: http://ofbiz.135035.n4.nabble.com/How-To-Use-JSP-Custom-Tag-Within-Freemarker-Template-Page-tp1585638p2022927.html
Sent from the OFBiz - User mailing list archive at Nabble.com.