my web.xml is based on web-app_2_4.xsd. This web.xml is not supporting <taglib> element. However, if I want to use tlds available through Struts package, I need to include <taglib> element for each tld. How can I accomplish this with this version of web.xml. Also in a book I'm referring to "Beginning Apache Strust - From Novice to Professional" it is mentioned to use web.xml that comes along with Struts ( I have Struts 1.2.7). This web.xml is based on web-app_2_2.dtd which has support for <taglib>.
The new recommended way of configuring tag libs are to add the taglib definitions to the top of your JSP like such: <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
The tlds are bundled in the struts jar in Struts1.3.8 so you do not need to configure them in web.xml, thank goodness. I am not sure if they are also bundled in the 1.2.7 struts jar, you will have to check that. If they are not bundled then you are out of luck and will not be able to use the 2.4 xsd.
Joined: Oct 20, 2007
Thanks to both of you.
Andy, actually the tlds are bundled along with struts 1.2.7 package, though not sure if they are bundled in struts.jar. I'll give a try using the recommendations otherwise I shall switch over to 2.2 version
Joined: Feb 15, 2005
In Struts 1.2.7, The TLDs are not bundled in any of the jar files. You just have to include them in the WEB-INF directory as is done in the struts-blank.war file that comes with the download.
Andy's statement about not being able to use the 2.4 xsd with Struts 1.2.7 is incorrect. As long as you make the taglib declarations properly, it should work fine.