Bug 4022

Summary: Multiple page directive import attributes within an XML syntax jsp, results in a fatal translation error.
Product: Tomcat 4 Reporter: Ryan Lubke <Ryan.Lubke>
Component: JasperAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 4.0 Final   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Ryan Lubke 2001-10-08 10:11:55 UTC
JavaServer Page Specification v 1.2 JSP.2.10.1 page 47 states:

"....However, there shall only be one occurrence of any attribute/value
defined by this directive in a given translation unit with the exception of 
the "import" attribute;...."

Reproduction:

*******************************************************
<?xml version="1.0" ?>
<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
>

<jsp:text><![CDATA[<html><title></title>
<body>
]]></jsp:text>

<jsp:directive.page language="java" import="java.util.Properties"
import="java.util.Hashtable" />

<jsp:text><![CDATA[

</body>
</html>
]]></jsp:text>

</jsp:root>

*************************************************************

When this page is run agaist Tomcat, a fatal translation error
occurs stating that the import attribute has already appeared in this
tag.

This is not an issue for jsp syntax pages.
Comment 1 Kin-Man Chung 2001-10-08 18:31:02 UTC
Technically, this bug is invalid, because the <jsp:directive.page> element
specifies the "import" attribute twice, which would be illegal in XML.  If the
directive is modified to

	<jsp:directive.page language="Java"
import="java.util.Properties,java.util.HashTable" />

then it acts as expected.

However, I am keeping this bug open, because (noted by Craig R. McClanahan)

There is still an implementation bug and a spec bug:

IMPLEMENTATION:  When translating a JSP syntax page to XML syntax, we need to
collapse multiple "import" attributes into a single one, with commas separating
all the different expressions.

SPECIFICATION:  Section 5.3.4 (the page directive) needs to be changed to
mandate this translation.  In addition, it might be appropriate to mention
someplace that an XML-syntax input page cannot have two "import" attributes on
the <jsp:directive.page> element.
Comment 2 Kin-Man Chung 2001-10-09 11:50:43 UTC
Fixed the translation of JSP syntax to XML syntax problem mentioned above.