Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confused by taglibs

 
Mike Himstead
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

sorry for this dumb question, I'm confused about the usage of taglibs. I have a JSP making use of the following libs:

<%@ taglib uri="/WEB-INF/tld/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>

Where can I find info and documentations for the mentioned libraries? I browsed Struts' homepage but couldn't find a place to read or download documentations for these libs. As far as I know, c.tld and fmt.tld are pretty much standard libs, aren't they?

The Struts version in use is 1.2.4, the JSTL are in use as well.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For Struts 1.2.4, here is the link for the user guide:

http://struts.apache.org/1.2.4/userGuide/index.html

Once this page is displayed, you will see links for each of the taglibs on the left navigation panel.

Regarding the "c" and "fmt" taglibs, the way you have defined them is not the usual way to define them. Since these taglibs are contained within jstl.jar and standard.jar, they are normally declared by their namespace. Example:

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>

If you use these declarations, the TLDs will be found in the jar file. There is no need to extract them or declare them anywhere else. The above works if your Application Server supports J2EE 1.3 (Tomcat 4). If your App server uses J2EE 1.4 (Tomcat 5), use the following declarations:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
 
Mike Himstead
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic