Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tld files for struts 1.3.5

 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i declare the tld for struts 1.3.5. i using the following method but it cant work.


web.xml:
<taglib>
<taglib-uri>http://struts.apache.org/tags-bean</taglib-uri>
<taglib-location>/META-INF/tld/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts.apache.org/tags-html</taglib-uri>
<taglib-location>/META-INF/tld/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts.apache.org/tags-logic</taglib-uri>
<taglib-location>/META-INF/tld/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts.apache.org/tags-tiles</taglib-uri>
<taglib-location>/META-INF/tld/struts-tiles.tld</taglib-location>
</taglib>

jsp page:
<%@ 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-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>

what goes wrong??? i try to open the jar files, but i cant find any .tld files. Where are the tld places?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Struts 1.3.5 you do not need to declare the taglibs in web.xml. Just take out all the taglib references from your web.xml file.

Struts 1.3.5 uses the newer style taglib URIs where the URI used is actually a namespace, and is found by searching in the META-INF directories of the jar files. As long as you have struts-taglib-1.3.5.jar in your /lib diretory, the references will be resolved properly.
 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i get the following error, when deploy in tomcat4.1:

org.apache.jasper.JasperException: This absolute uri (http://struts.apache.org/tags-bean) cannot be resolved in either web.xml or the jar files deployed with this application
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that struts-taglib-1.3.5.jar exists in the WEB-INF/lib directory of your web application?
 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have check my web application. the file is there. In netbean when i run the project, i can view the pages and everythng works fine. Is only that when i copy and war file and deploy it in tomcat, then i will have the error.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic