StrutsAndJSTL

HomePage | RecentChanges | Preferences

This Page Has Moved To http://wiki.apache.org/struts/StrutsAndJSTL

Please visit this page on the Struts wiki, where you may (create an account and) modify it.

Which version of JSTL should I use with Struts?

What version of Struts am I using?

If there is no version number in the filename, (i.e., struts-1.2.9.jar,) then look inside WEB-INF/lib/struts.jar (or possibly struts-core.jar) and examine the contents of the MANIFEST.MF file.

What version of the Servlet spec am I using?

Look at the top of WEB-INF/web.xml and compare to the snippets in each section below.

Your Servlet container may support versions other than the one your particular application is using. For example, Tomcat 5.5 supports Servlet 2.4, but will also run applications configured for Servlet 2.3 and (probably, haven't tried it,) Servlet 2.2. See also: Java/Specifications

Servlet 2.2

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

Servlet 2.3

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

   <%@ taglib uri="http://struts.apache.org/tags-bean-el" prefix="bean" %>
   <%@ taglib uri="http://struts.apache.org/tags-html-el" prefix="html" %>

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

Servlet 2.4

<web-app      xmlns="http://java.sun.com/xml/ns/j2ee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
                     http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
            version="2.4">

   <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
   <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>

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

Notes

What we call "JSTL" is really the JavaServer Pages Standard Tag Library Specification. There is a Reference Implementation available from Sun at the bottom of http://jcp.org/aboutJava/communityprocess/final/jsr052/


Jakarta has an implementation of the specification, called "Jakarta Standard Taglib". (One implementation for each version of the JSTL spec.) And that (the 1.0 verson) is what Struts distributes with Struts-EL.



HomePage | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited July 21, 2006 10:35 am by WendySmoak (diff)
Search: