wood burning stoves 2.0*
The moose likes Struts and the fly likes Confused by taglibs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Confused by taglibs" Watch "Confused by taglibs" New topic

Confused by taglibs

Mike Himstead
Ranch Hand

Joined: Apr 12, 2006
Posts: 178

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

Joined: Feb 15, 2005
Posts: 4864
For Struts 1.2.4, here is the link for the user guide:


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" %>

Consultant, Sima Solutions
Mike Himstead
Ranch Hand

Joined: Apr 12, 2006
Posts: 178
Thank you very much.
wood burning stoves
subject: Confused by taglibs