1

I am not seeing the .tld file in my download folder. I only see JAR files. What I am missing?

My problem is that, I can't refer like this in my JSP:

<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>

I get some error. Hence want to download .tld and put it under local WEB-INF folder and then change my JSP like this:

<%@ taglib uri="/WEB-INF/displaytag.tld" prefix="display" %>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Vani
  • 11
  • 1
  • 3
  • It would help us if you told us what error you are getting. Having the TLD files within the WEB-INF directory hasn't been a requirement for some years since they're bundled within the tag library JAR. – John Topley Dec 02 '09 at 16:16
  • Tahnks John. This is the error I get Parsing of JSP File '/jsp/cdessSearch.jsp' failed: -------------------------------------------------------------------------------- /jsp/cdessSearch.jsp(8): Could not parse deployment descriptor: java.io.IOException: cannot resolve 'http://displaytag.sf.net' into a valid tag library probably occurred due to an error in /jsp/cdessSearch.jsp line 8: <%@ taglib uri="http://displaytag.sf.net" prefix="display" %> – Vani Dec 02 '09 at 16:17
  • Also, why I don't see displaytag/tld in my downloaded folder. They clearly say that it includes jar and tld files. Am I downloading the wrong one? – Vani Dec 02 '09 at 16:20

3 Answers3

1

You don't need the loose TLD. It's already inside the JAR file. Just put the downloaded JAR file in /WEB-INF/lib. That's all. No, not in /WEB-INF, this is not covered by the default classpath.

You only need to ensure that the taglib URI is correct. Else it will indeed complain about that. The correct one is usually to be found in the documentation of the library in question.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
1

Download displaytag jar and extract this jar file first. Then, find the METS-INF folder . Inside this META-INF folder, you will find the displaytag.tld file.

WEFX
  • 8,298
  • 8
  • 66
  • 102
0

you will have to make entry in your web.xml file for your local displaytag.tld file..

<jsp-config>
<taglib>
<taglib-uri>
any uri but this must be same as in jsp's uri one
</taglib-uri>
<taglib-location>
location of tld file
</taglib-location>
</taglib>
</jsp-config>
Vishal Sharma
  • 2,773
  • 2
  • 24
  • 36