You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrew May <am...@ingenta.com> on 2003/03/24 11:40:56 UTC

Problem with taglib declarations in Tomcat 4.1.18

Hi, we've just upgraded the version of JBoss that we're running our J2EE application on, 
and this has meant an upgrade to the servlet and JSP engines.

We've started having problems with our JSPs not validating due to the same taglib being 
declared multiple times.

The exception is:
org.apache.jasper.JasperException: <h3>jsp.error.tlv.invalid.page</h3><p>null: 
org.xml.sax.SAXParseException: Attribute "xmlns:c" was already specified for element 
"jsp:root".</p>
         at 
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:105)
         at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:430)
         at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:112)
         at org.apache.jasper.compiler.Validator.validateXmlView(Validator.java:661)
         at org.apache.jasper.compiler.Validator.validate(Validator.java:613)

In the application the core JSTL taglib is being declared in a template JSP which is 
statically including other JSP fragments that also declare the taglib (because they may or 
may not be included by something that uses the JSTL taglib).

It's also possible to recreate the error with a trivial JSP like:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head><title>Test</title></head>
<body>
Test
</body>
</html>

where the WAR only contains the test jsp, a basic web.xml and standard.jar (the JSTL tags) 
in WEB-INF/lib. The error occurs both in JBoss with the bundled servlet engine, or with a 
standalone version of Tomcat.

As far as we're aware there's nothing in the spec that says the same taglib can't be 
declared twice, and this page worked in earlier versions.

Is this a bug in Jasper (should it be ignorning duplicate declarations where both the 
prefix and uri are the same), or is our use of the taglib invalid?

Any help would be greatly appreciated.

Thanks,

Andrew


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org