• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

adding taglib to web.xml

 
jude epoh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i'm a newbie to struts and what i'm trying to do is the basic hello world tag example from the jakarta website.
and what i'm wondering about is the uri in web.xml, what exactly do i need to change this too?

<web-app>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/utilitytags</taglib-uri>
<taglib-location>/WEB-INF/tld/utilitytags.tld</taglib-location>
</taglib>
</web-app>

i have tried various combiatios of what i thought may do the trick such as
struts/taglibs/utilitytags, struts/taglib/utilitytags, utilitytags, struts/taglib etc.

these are the other taglibs i have in web.xml with which i have no problem running tomcat. but when i put in the utilitytags.tld i cannot run tomcat due the uri not being correct i suspect.
<taglib>
<taglib-uri>struts/bean-el</taglib-uri>
<taglib-location>/WEB-INF/struts-bean-el.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>struts/html-el</taglib-uri>
<taglib-location>/WEB-INF/struts-html-el.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>struts/logic-el</taglib-uri>
<taglib-location>/WEB-INF/struts-logic-el.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>jstl/c</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>struts/taglib</taglib-uri>
<taglib-location>/WEB-INF/taglib.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>struts/taglibs/displaytag-el</taglib-uri>
<taglib-location>/WEB-INF/displaytag-el.tld</taglib-location>
</taglib>

thanks for any/all help.
 
Ravi Seshu
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i think the relative path and location should be specified there, like
uri which we use in jsp, location where the file is located, so better follow the path and put it in location part of taglib.

-eswar
 
jude epoh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, thanks for your reply.
so do you mean like this

<taglib>
<taglib-uri>/WEB-INF/displaytag-el.tld</taglib-uri>
<taglib-location>/WEB-INF/displaytag-el.tld</taglib-location>
</taglib>

as this is what i have in my jsp page:
<%@ taglib uri="/WEB-INF/displaytag-el.tld" prefix="display" %>

but this doesn't work either!


This is what i have in my jsp page for struts-bean-el.tld
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean" %>
and this in the web.xml
<taglib>
<taglib-uri>struts/bean-el</taglib-uri>
<taglib-location>/WEB-INF/struts-bean-el.tld</taglib-location>
</taglib>
and this works.
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic