tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Bergsten <h...@gefionsoftware.com>
Subject Re: Unable to open taglibrary
Date Mon, 03 Apr 2000 18:41:55 GMT
Lena Lindström wrote:
> 
> Hi,
>     I'm a new user of JSP and I am trying to use the taglib element, but it won't work.
:(
> 
> I'm running the tomcat server in location D:\tomcat\bin.
> I haven't made any changes to server.xml, but I have added the taglib to D:\tomcat\conf\web.xml,
like this (after <web-app>). I have restarted tomcat after these changes.
> 
>     <taglib>
>      <taglib-uri>/dlexpress/taglib</taglib-uri>
>      <taglib-location>http://localhost:8080/examples/WEB-INF/tlds/taglib.tld</taglib-location>
>     </taglib>
> 
> My library is located in D:\tomcat\webapps\examples\WEB-INF\tlds and its name is taglib.tld.
> 
> I am referring to the library from my JSP page (template.jsp) like this:
> <%@ taglib uri="/dlexpress/taglib" prefix="j2ee" %>

When you use the <taglib> element in web.xml to specify the location of
the TLD, the uri must be the same as you use in the taglib directive
(the recommendation is that it's a URL but it can be any symbolic name
you like) and the location must be the physical location of the TLD,
as a path relative to the context document base. With the info you have
provided, it should look like this:

     <taglib>
      <taglib-uri>/dlexpress/taglib</taglib-uri>
      <taglib-location>/WEB-INF/tlds/taglib.tld</taglib-location>
     </taglib>

Hans
PS. This type of question is better sent to the Tomcat user list, see
the web site for how to sign up.
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com

Mime
View raw message