Looking at the documentation for the web.xml, it reads:
taglib-uri:
The taglib-uri element describes a URI, relative to the
location of the web.xml document, identifying a Tag
Library used in the Web Application.
taglib-location:
the taglib-location element contains the location (as a
resource relative to the root of the web application)
where to find the Tag Libary Description file for the
tag library.
So, for example, if your web.xml has
taglib
taglib-urihttp://www.acme.com/logic/taglib-uri
taglib-location/WEB-INF/tlds/struts-logic.tld/taglib-location
/taglib
you can place the taglib directive
%@ taglib uri=http://www.acme.com/logic; prefix=logic %
in your JSP. The web.xml taglib provides a level of indirection thereby allowing
you to say, move your tlds or use a newer version without having to update all your
JSPs.
I *do* have every taglib that I use in my application declared in the web.xml.
Sri
-Original Message-
From: Heligon Sandra [mailto:[EMAIL PROTECTED]
Sent: Monday, March 24, 2003 4:20 AM
To: '[EMAIL PROTECTED]'
Subject: Declaration of the Struts tag librairies
I develop a web application with Tomcat4.0.1 and the Struts framework.
In the web.xml there is an optional taglib element. I don't understand very
well the aim of this element.
In the beginning of the development I added the following libraries:
taglib
taglib-uri/WEB-INF/struts-bean.tld/taglib-uri
taglib-
location/WEB-INF/tld/struts-bean.tld/taglib-location
/taglib
taglib
taglib-uri/WEB-INF/struts-html.tld/taglib-uri
taglib-location/WEB-INF/tld/struts-html.tld/taglib-location
/taglib
and in the JSP that use these libraries I added in the header:
%@ taglib uri=/WEB-INF/tld/struts-bean.tld prefix=logic %
%@ taglib uri=/WEB-INF/tld/struts-html.tld prefix=logic %
In the continuation of my developments I used new libraries which I did not
declare in web.xml
But in the JSP that use these new libraries I wrote a line
%@ taglib uri=/WEB-INF/tld/struts-logic.tld prefix=logic % and it works,
why ?
Is it with the fact that the two directives are identical?
I do'nt understand well which is the aim of the taglib element ? Do I must
declare each library used in the
Struts application in the web.xml file ?
As of February 12th, 2003 Thomson unifies its email addresses on a worldwide basis.
Please note my new email address: [EMAIL PROTECTED]
http://www.thomson.net/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]