Bug 4022 - Multiple page directive import attributes within an XML syntax jsp, results in a fatal translation error.
Summary: Multiple page directive import attributes within an XML syntax jsp, results i...
Alias: None
Product: Tomcat 4
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 4.0 Final
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2001-10-08 10:11 UTC by Ryan Lubke
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
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;...."


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


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





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

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.