- This topic has 13 replies, 5 voices, and was last updated 20 years, 8 months ago by
Riyad Kalla.
-
AuthorPosts
-
andmerMemberHi all,
in my web.xml I have this:
<taglib>
<taglib-uri>http://opensymphony.com/oscache</taglib-uri>
<taglib-location>/WEB-INF/lib/oscache-2.0.2.jar</taglib-location>
</taglib>and in my jsp i have this:
<%@ taglib uri=”http://opensymphony.com/oscache” prefix=”oscache” %>the TLD is in the jar file, however i get the error
“could not load TLD for uri=http://opensymphony.com/oscache”Not sure why its not picking it up.
andmerMemberoh by the way this is in eclipse 3RC2, and 3.8 beta1
Riyad KallaMemberRemove your taglib entry from the web.xml file, and add your oscache.jar file to your build path, then it will work. (struts does the same thing)
andmerMemberHey thanks for the help, but I still have the same error message though.
I removed the taglib entry from my web.xml, and oscache.jar was already in my build path as it is in WEB-INF/lib.
andmerMemberi think the problem is with their TLD. gonna try and figure out why.
andmerMember<?xml version=”1.0″ encoding=”ISO-8859-1″ ?>
<!DOCTYPE taglib PUBLIC “-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN” “http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd”>
<taglib>
<tlib-version>1.6</tlib-version>
<jsp-version>1.1</jsp-version>
<short-name>oscache</short-name>
<uri>http://opensymphony.com/oscache</uri>
<description>OSCache – see http://www.opensymphony.com/oscache</description><tag>
<name>cache</name>
<tag-class>com.opensymphony.oscache.web.tag.CacheTag</tag-class>
<body-content>JSP</body-content>
<description>A tag to cache post-processed JSP contents</description><attribute>
<name>time</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>duration</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>cron</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>refreshpolicyclass</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>refreshpolicyparam</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>scope</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>refresh</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>mode</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>key</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>groups</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>language</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag><tag>
<name>usecached</name>
<tag-class>com.opensymphony.oscache.web.tag.UseCachedTag</tag-class>
<description>A tag to tell the cache to use the cached version</description><attribute>
<name>use</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag><tag>
<name>flush</name>
<tag-class>com.opensymphony.oscache.web.tag.FlushTag</tag-class>
<description>A tag to flush the cache</description><attribute>
<name>scope</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>key</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>group</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>language</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>pattern</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag><tag>
<name>addgroup</name>
<tag-class>com.opensymphony.oscache.web.tag.GroupTag</tag-class>
<description>A tag to add a group to an ancestor cache tag</description>
<attribute>
<name>group</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag></taglib>
No OperationMember<taglib>
<taglib-uri>http://opensymphony.com/oscache</taglib-uri>
<taglib-location>/WEB-INF/lib/oscache-2.0.2.jar</taglib-location>
</taglib>This maps the URI to the file “taglib.tld” in folder META-INF/taglib.tld.
Since your taglib.tld file contains exactly the same URI, the declaration in web.xml is kind of superfluos.
But it has one use:
It disables ALL other tld files containing the same URI but the one tld file at META-INF/taglib.tld in the /WEB-INF/lib/oscache-2.0.2.jar.Q: Where is your tld file located?
NOP
andmerMemberyeah, it is. Originally the tld did not have <uri>http://opensymphony.com/oscache</uri>, i added that myself this morning so it would not need the web.xml locator.
the tld is in the jar META-INF.
support-michaelKeymasterDid your recent change resolve the problem?
andmerMemberyes
andmerMemberactually the main problem i’ve found is with tld’s that have <jspversion>1.1</jspversion> in them, this seems to cause problems. I change it to 1.2 and issues go away.
support-michaelKeymasterGood feedback. The ME JSPCC compiler is JSP 1.2 spec level and that is what we have concentrated testing towards for quite sometime. I’m adding this info to a tracking record for future investigation and reference.
Skip HollowellMemberIf you are testing towards JSP1.2 spec level, that is fine, but what about the core taglib TLDs from Struts? They are all jspversion 1.0. I am getting bogus errors like crazy in my JSP now when making any struts taglib calls. Am I expected to change the core TLD files in struts, inlcuding the ones you package with ME?
Riyad KallaMemberOn this subject of OSCache and the taglib resolution, I’ve added a post here: https://www.genuitec.com/forums/topic/1st-tag-ref-in-the-jsp-gives-could-not-load-tld-closed/#post-209431
Basically the problem is that OSCache’s TLD file doesn’t define a default URI for the tags, so MyEclipse can’t resolve them to anything. But that’s not the real issue, the OSCache TLD install instructions are clear that you should copy the TLD file from the download (its in the /etc dir) into another dir in you project, and then reference THAT file in your <taglib> entry in the web.xml file.
-
AuthorPosts