Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Struts and the fly likes Struts taglibs - references - doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts taglibs - references - doubt" Watch "Struts taglibs - references - doubt" New topic

Struts taglibs - references - doubt

Manuel Jordan
Ranch Hand

Joined: Sep 29, 2006
Posts: 131
Hello guys, i saw in most examples when work with struts only, this
i must declare in the web.xml (for tomcat) the follow taglibs

in for any jsp file (with/out tiles) these lines

ok i undestood this and work and i dont have any problem

the doubt is the next, this behaviour is with struts-spring(i dont know if exist with struts only):

i can avoid the declaration in the web.xml of the tags <taglib>, but i must still have the folder path
/WEB-INF/tlds/*.tld in my application,i known that all the tld files are in the

so how change <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> to make reference
to the struts-logic.tld file that is incorporate in the struts.jar and of course this should avoid the
folder and files in /WEB-INF/tlds/*.tld

thanks so much for advanced

Manuel Jordan

kill your pride, share your knowledge with all
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
If you want to refer to the TLDs in the struts.jar file, use their namespace URIs. Read my response in this thread for an explanation of how that works.

For example, to use the html taglib that is contained in the struts.jar file, you would code the following:

<%@ taglib uri="" prefix="html" %>

Consultant, Sima Solutions
Manuel Jordan
Ranch Hand

Joined: Sep 29, 2006
Posts: 131
hello Merrill
thanks for the reply, your link was useful

but i have a doubt, i saw the war files of the bin distribution of Struts, and all the samples work with the clasic way (web.xml and declaration etc etc)

the obvious question is, where i can find an example of this (make a reference to the jar file) or documentation/tutorial but from the same source???

thanks for your time
i work with struts 1.2.9, because is need it by Spring
[ November 06, 2006: Message edited by: Manuel Jordan ]
Manuel Jordan
Ranch Hand

Joined: Sep 29, 2006
Posts: 131
i hope that this option work with struts 1.2.9

I agree. Here's the link:
subject: Struts taglibs - references - doubt
It's not a secret anymore!