Bug 24776

Summary: org.apache.taglibs.standard.tag.common.xml.XPathUtil.JstlVariableContext deriving from final class
Product: Taglibs Reporter: Sebastian Redl <wasti.redl>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED INVALID    
Severity: major    
Priority: P3    
Version: 1.1   
Target Milestone: ---   
Hardware: Other   
OS: All   

Description Sebastian Redl 2003-11-18 11:37:01 UTC
Taglibs: Taglibs Standard 1.1.0-B1
Tomcat: 5.0.14
J2SE: 1.4.1_02
Xalan: 2.5.2 or whatever version comes with my JRE

It seems that the class mentioned in the summary derives from
org.apache.xpath.VariableStack, which is part of Xalan. This class, however, is
declared as final in both tested Xalan versions and XPathUtil thus fails to
load. This renders all xml jstl tags unusable.

Steps to reproduce:
1) Add any xml jstl tag with a select attribute to a jsp page.
2) Try to view the page. A ServletException as the result of a ValidationError
will occur. Origin comes down to the place where XPathUtil is instantiated.

Proposed solution:
If no component tries to cast the JstlVariableStack to a VariableStack,
aggregation instead of derivation would suffice. Otherwise a change to Xalan
might be required.
Comment 1 Sebastian Redl 2003-11-18 12:04:20 UTC
Ok, seems to me like I was wrong. Anyone knows how to prevent java from loading
the Xalan version in rt.jar?

Propose RESOLVED/INVALID
Comment 2 Pierre Delisle 2003-11-18 13:01:36 UTC
As stated in the README file of Taglibs Standard 1.1.0-B1:

---------------------------------------------------------------------------
LIBRARY DEPENDENCIES

This version of the Standard Tag Library has the following runtime
dependencies:

   1. Dependencies provided by the JSP 2.0 container:
      - Servlet 2.4
      - JSP 2.0

   2. Dependencies provided in newer J2SEs (1.4.2 and higher)
      - JAXP 1.2 
      - Xalan 2.5 
      - JDBC Standard Extension 2.0

Since all of the dependencies in (2) are included in Sun's
distribution of J2SE 1.4.2 (and higher), this is therefore the J2SE
version of choice to use the standard tag library.

If the java platform under which you run your JSP container does not
provide these dependencies, they must be made available either globally
to all web-applications by your container, or individually within the
WEB-INF/lib directory of your web-application.

For convenience, these jar files have been included in directory 
lib/old-dependencies of this distribution (assuming the build process
of this distribution included them). If you would like to download
these jar files yourself, instructions on where you can get them are 
included below.

---
JAXP 1.2

The JAXP 1.2 jar files can be obtained in the Java Web Services
Developer Pack (JWSDP) available at 
http://java.sun.com/products/jwsdp.

  - jaxp-api.jar
  - dom.jar
  - sax.jar
  - xercesImpl.jar

---
Xalan 2.5

The Xalan jar file can be obtained in the Java Web Services
Developer Pack (JWSDP) available at 
http://java.sun.com/products/jwsdp, as well as from 
Apache at http://xml.apache.org/xalan-j.

  - xalan.jar

Please note that if you use Sun's distribution of J2SE 1.4.1, you must
supersede the version of xalan.jar provided by the J2SE with version
2.5 or higher of Xalan.  This newer version of xalan.jar must then be
made available through the endorsed dirs mechanism.