Quantcast

Issue while integrating custom taglibs in Freemarker template

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Issue while integrating custom taglibs in Freemarker template

Abutalib Shaikh
Hello all,
We are facing problem while integrating custom tag library in freemaker template.
We are using Jforum2.1.8 , Tomcat 7 and freemarker-2.3.9 in our development environment.
The configuration of .tld file as

<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd">
 
    <description>
       Social Sharing tag library.
    </description>
    <display-name>Social Sharing Taglib</display-name>
    <tlib-version>1.0</tlib-version>
    <short-name>forms</short-name>
    <uri>/WEB-INF/taglibs/social-sharing</uri>
    <tag>
        <description>
            Display Social Icons.
        </description>
        <name>SocialSharingButton</name>
        <tag-class>com.social.tags.SocialSharingButtonTag</tag-class>
        <body-content>JSP</body-content>
        <attribute>
            <name>service</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>url</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>countEnabled</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>text</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>summary</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>source</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>status</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>label</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>   
    </tag>
</taglib>

We include taglibs as follow in template file

<#assign social=JspTaglibs["/WEB-INF/taglibs/social-sharing"]/>

But we got following error logs while running sever.
Document root element "taglib", must match DOCTYPE root "null".
Document is invalid: no grammar found.


is freemarker support taglibs like JSP taglib
Is there any step we missing for configuration of taglibs? or Is there any alternate way to configuration of taglibs? Please Suggest.


Thanks in Advance
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue while integrating custom taglibs in Freemarker template

Daniel Dekany
Is that really FreeMarker 2.3.9? That's more than 9 years old. So as a
first attempt, upgrade to the the latest version.

Note that this mailing list has been retired long ago. See:
http://freemarker.org/mailing-lists.html


Thursday, April 21, 2016, 7:56:36 AM, Abutalib Shaikh wrote:

> Hello all,
> We are facing problem while integrating custom tag library in freemaker
> template.
> We are using Jforum2.1.8 , Tomcat 7 and freemarker-2.3.9 in our development
> environment.
> The configuration of .tld file as
>
> <?xml version="1.0" encoding="UTF-8"?>
> <taglib version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd">
>  
>     <description>
>        Social Sharing tag library.
>     </description>
>     <display-name>Social Sharing Taglib</display-name>
>     <tlib-version>1.0</tlib-version>
>     <short-name>forms</short-name>
>     <uri>/WEB-INF/taglibs/social-sharing</uri>
>     <tag>
>         <description>
>             Display Social Icons.
>         </description>
>         <name>SocialSharingButton</name>
>         <tag-class>com.social.tags.SocialSharingButtonTag</tag-class>
>         <body-content>JSP</body-content>
>         <attribute>
>             <name>service</name>
>             <required>true</required>
>             <rtexprvalue>true</rtexprvalue>
>         </attribute>
>         <attribute>
>             <name>url</name>
>             <required>false</required>
>             <rtexprvalue>true</rtexprvalue>
>         </attribute>
>         <attribute>
>             <name>countEnabled</name>
>             <required>false</required>
>             <rtexprvalue>true</rtexprvalue>
>         </attribute>
>         <attribute>
>             <name>text</name>
>             <required>false</required>
>             <rtexprvalue>true</rtexprvalue>
>         </attribute>
>         <attribute>
>             <name>summary</name>
>             <required>false</required>
>             <rtexprvalue>true</rtexprvalue>
>         </attribute>
>         <attribute>
>             <name>source</name>
>             <required>false</required>
>             <rtexprvalue>true</rtexprvalue>
>         </attribute>
>         <attribute>
>             <name>status</name>
>             <required>false</required>
>             <rtexprvalue>true</rtexprvalue>
>         </attribute>
>         <attribute>
>             <name>label</name>
>             <required>true</required>
>             <rtexprvalue>true</rtexprvalue>
>         </attribute>  
>     </tag>
> </taglib>
> *
> We include taglibs as follow in template file *
> *<#assign social=JspTaglibs["/WEB-INF/taglibs/social-sharing"]/>*
>
> *But we got following error logs while running sever. *
> *Document root element "taglib", must match DOCTYPE root "null".
> Document is invalid: no grammar found.*
> *
> is freemarker support taglibs like JSP taglib
> Is there any step we missing for configuration of taglibs? or Is there any
> alternate way to configuration of taglibs? Please Suggest.*
>
> Thanks in Advance
>
>
>
> --
> View this message in context:
> http://freemarker.624813.n4.nabble.com/Issue-while-integrating-custom-taglibs-in-Freemarker-template-tp4655620.html
> Sent from the freemarker-user mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> FreeMarker-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>

--
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Loading...