Login  Register

Freemarker JspTaglibs error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Freemarker JspTaglibs error

madppiper-2
151 posts
Hey,

when trying to use an external taglib (jakarta image taglib) in ofbiz, i receive the following error:

---- exception report ----------------------------------------------------------
Error rendering included template at location [component://brandsparadise/webapp/brandsparadise/includes/catalog/productsamples.ftl]: freemarker.template.TemplateModelException: Could not find an instance of freemarker.ext.servlet.ServletContextHashModel in the data model under either the name __FreeMarkerServlet.Application__ or Application
Exception: freemarker.template.TemplateModelException
Message: Could not find an instance of freemarker.ext.servlet.ServletContextHashModel in the data model under either the name __FreeMarkerServlet.Application__ or Application
---- stack trace ---------------------------------------------------------------
Could not find an instance of freemarker.ext.servlet.ServletContextHashModel in the data model under either the name __FreeMarkerServlet.Application__ or Application
The problematic instruction:
----------
==> user-directive img.image [on line 74, column 1 in component://brandsparadise/webapp/brandsparadise/includes/catalog/productsamples.ftl]
----------
Java backtrace for programmers:
----------
freemarker.template.TemplateModelException: Could not find an instance of freemarker.ext.servlet.ServletContextHashModel in the data model under either the name __FreeMarkerServlet.Application__ or Application
freemarker.ext.jsp.FreeMarkerPageContext.<init>(FreeMarkerPageContext.java:124)
freemarker.ext.jsp.FreeMarkerPageContext2.<init>(FreeMarkerPageContext2.java:21)
freemarker.ext.jsp.FreeMarkerPageContext2.create(FreeMarkerPageContext2.java:25)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)







I added the Taglib to my freemarker file:

<#assign img=JspTaglibs["/WEB-INF/taglibs-image.tld"]>

and also put all dependencies in place. I am accessing the taglib as such (this should be fine):

<@img.image src="/images/bpimg/price_placeholder.gif"
               name="price.png"
               refresh="true"
                quality="1.0" display="false">
                   
</@img.image>




I think the dependencies get loaded just fine, so perhaps there is something else I am missing? I am using Revision 711975 btw
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Freemarker JspTaglibs error

BJ Freeman
6819 posts
the Regions, Taglib, and Jsp have been deprecated some time ago.
Freemaker FtL extention is the only ones recognized.


madppiper sent the following on 12/5/2008 2:06 AM:

> Hey,
>
> when trying to use an external taglib (jakarta image taglib) in ofbiz, i
> receive the following error:
>
> ---- exception report
> ----------------------------------------------------------
> Error rendering included template at location
> [component://brandsparadise/webapp/brandsparadise/includes/catalog/productsamples.ftl]:
> freemarker.template.TemplateModelException: Could not find an instance of
> freemarker.ext.servlet.ServletContextHashModel in the data model under
> either the name __FreeMarkerServlet.Application__ or Application
> Exception: freemarker.template.TemplateModelException
> Message: Could not find an instance of
> freemarker.ext.servlet.ServletContextHashModel in the data model under
> either the name __FreeMarkerServlet.Application__ or Application
> ---- stack trace
> ---------------------------------------------------------------
> Could not find an instance of freemarker.ext.servlet.ServletContextHashModel
> in the data model under either the name __FreeMarkerServlet.Application__ or
> Application
> The problematic instruction:
> ----------
> ==> user-directive img.image [on line 74, column 1 in
> component://brandsparadise/webapp/brandsparadise/includes/catalog/productsamples.ftl]
> ----------
> Java backtrace for programmers:
> ----------
> freemarker.template.TemplateModelException: Could not find an instance of
> freemarker.ext.servlet.ServletContextHashModel in the data model under
> either the name __FreeMarkerServlet.Application__ or Application
> freemarker.ext.jsp.FreeMarkerPageContext.<init>(FreeMarkerPageContext.java:124)
> freemarker.ext.jsp.FreeMarkerPageContext2.<init>(FreeMarkerPageContext2.java:21)
> freemarker.ext.jsp.FreeMarkerPageContext2.create(FreeMarkerPageContext2.java:25)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>
>
>
>
>
>
> I added the Taglib to my freemarker file:
>
> <#assign img=JspTaglibs["/WEB-INF/taglibs-image.tld"]>
>
> and also put all dependencies in place. I am accessing the taglib as such
> (this should be fine):
>
> <@img.image src="/images/bpimg/price_placeholder.gif"
>                name="price.png"
>                refresh="true"
>                 quality="1.0" display="false">
>                    
> </@img.image>
>
>
>
> I think the dependencies get loaded just fine, so perhaps there is something
> else I am missing? I am using Revision 711975 btw
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Freemarker JspTaglibs error

madppiper-2
151 posts
hmm... so is there any possible way to include jsptaglibs? or would I need to access the taglibs using bash files?
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Freemarker JspTaglibs error

BJ Freeman
6819 posts
your are attempting things beyond ofbiz design.
so you on your own.

madppiper sent the following on 12/5/2008 2:26 AM:
> hmm... so is there any possible way to include jsptaglibs? or would I need to
> access the taglibs using bash files?
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Freemarker JspTaglibs error

Adrian Crum-2
925 posts
In reply to this post by madppiper-2
Did you try asking this question on the FreeMarker mailing list?

-Adrian


--- On Fri, 12/5/08, madppiper <[hidden email]> wrote:

> From: madppiper <[hidden email]>
> Subject: Freemarker JspTaglibs error
> To: [hidden email]
> Date: Friday, December 5, 2008, 2:06 AM
> Hey,
>
> when trying to use an external taglib (jakarta image
> taglib) in ofbiz, i
> receive the following error:
>
> ---- exception report
> ----------------------------------------------------------
> Error rendering included template at location
> [component://brandsparadise/webapp/brandsparadise/includes/catalog/productsamples.ftl]:
> freemarker.template.TemplateModelException: Could not find
> an instance of
> freemarker.ext.servlet.ServletContextHashModel in the data
> model under
> either the name __FreeMarkerServlet.Application__ or
> Application
> Exception: freemarker.template.TemplateModelException
> Message: Could not find an instance of
> freemarker.ext.servlet.ServletContextHashModel in the data
> model under
> either the name __FreeMarkerServlet.Application__ or
> Application
> ---- stack trace
> ---------------------------------------------------------------
> Could not find an instance of
> freemarker.ext.servlet.ServletContextHashModel
> in the data model under either the name
> __FreeMarkerServlet.Application__ or
> Application
> The problematic instruction:
> ----------
> ==> user-directive img.image [on line 74, column 1 in
> component://brandsparadise/webapp/brandsparadise/includes/catalog/productsamples.ftl]
> ----------
> Java backtrace for programmers:
> ----------
> freemarker.template.TemplateModelException: Could not find
> an instance of
> freemarker.ext.servlet.ServletContextHashModel in the data
> model under
> either the name __FreeMarkerServlet.Application__ or
> Application
> freemarker.ext.jsp.FreeMarkerPageContext.<init>(FreeMarkerPageContext.java:124)
> freemarker.ext.jsp.FreeMarkerPageContext2.<init>(FreeMarkerPageContext2.java:21)
> freemarker.ext.jsp.FreeMarkerPageContext2.create(FreeMarkerPageContext2.java:25)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>
>
>
>
>
>
> I added the Taglib to my freemarker file:
>
> <#assign
> img=JspTaglibs["/WEB-INF/taglibs-image.tld"]>
>
> and also put all dependencies in place. I am accessing the
> taglib as such
> (this should be fine):
>
> <@img.image
> src="/images/bpimg/price_placeholder.gif"
>                name="price.png"
>                refresh="true"
>                 quality="1.0"
> display="false">
>                    
> </@img.image>
>
>
>
> I think the dependencies get loaded just fine, so perhaps
> there is something
> else I am missing? I am using Revision 711975 btw
> --
> View this message in context:
> http://www.nabble.com/Freemarker-JspTaglibs-error-tp20850917p20850917.html
> Sent from the OFBiz - User mailing list archive at
> Nabble.com.