pierred 00/12/08 12:45:19
Modified: jasper/src/share/org/apache/jasper/compiler
JspParseEventListener.java TagLibraryInfoImpl.java
XmlOutputter.java
Log:
Misc bug fixes for XML syntax processing.
Revision Changes Path
1.16 +9 -6
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java
Index: JspParseEventListener.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- JspParseEventListener.java 2000/12/05 12:23:46 1.15
+++ JspParseEventListener.java 2000/12/08 20:45:09 1.16
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.15 2000/12/05 12:23:46 pierred Exp $
- * $Revision: 1.15 $
- * $Date: 2000/12/05 12:23:46 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.16 2000/12/08 20:45:09 pierred Exp $
+ * $Revision: 1.16 $
+ * $Date: 2000/12/08 20:45:09 $
*
* ====================================================================
*
@@ -777,7 +777,9 @@
ex.getMessage());
}
}
- xo.append("jsp:directive." + directive, attrs);
+ if (!directive.equals("include")) {
+ xo.append("jsp:directive." + directive, attrs);
+ }
}
@@ -988,7 +990,6 @@
start, stop);
addGenerator(gen);
- xo.append(chars);
}
public void handleTagBegin(Mark start, Mark stop,
@@ -1034,7 +1035,7 @@
}
public void handleRootEnd() {
- xo.append("jsp:root");
+ xo.rootEnd();
}
public void handleRootBegin(Attributes attrs)
@@ -1076,6 +1077,7 @@
{
if (data != null) {
handleCharData(start, stop, data);
+ xo.append(data);
}
UninterpretedTagEndGenerator gen =
new UninterpretedTagEndGenerator(rawName);
@@ -1088,6 +1090,7 @@
throws JasperException
{
handleCharData(start, stop, data);
+ xo.append("jsp:cdata", null, data);
}
/**
1.16 +7 -9
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java
Index: TagLibraryInfoImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- TagLibraryInfoImpl.java 2000/11/18 22:36:48 1.15
+++ TagLibraryInfoImpl.java 2000/12/08 20:45:12 1.16
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
1.15 2000/11/18 22:36:48 pierred Exp $
- * $Revision: 1.15 $
- * $Date: 2000/11/18 22:36:48 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
1.16 2000/12/08 20:45:12 pierred Exp $
+ * $Revision: 1.16 $
+ * $Date: 2000/12/08 20:45:12 $
*
* The Apache Software License, Version 1.1
*
@@ -180,8 +180,6 @@
URL url = null;
boolean relativeURL = false;
- //p("prefix: " + prefix + " uriIn: " + uriIn);
- //if (location != null) p("location: " + location[0]);
if (location == null) {
// The URI points to the TLD itself or to a jar
// file where the TLD is located
@@ -215,23 +213,19 @@
parseTLD(location[0], in);
} else {
// Location points to a jar file
- // p("JAR FILE: " + location[0]);
// tag library in jar file
JarFile jarFile = null;
ZipEntry jarEntry = null;
InputStream stream = null;
try {
url = ctxt.getResource(location[0]);
- // p("url = " + url);
if (url == null) return;
url = new URL("jar:" + url.toString() + "!/");
JarURLConnection conn =
(JarURLConnection) url.openConnection();
conn.connect(); //@@@ necessary???
jarFile = conn.getJarFile();
- // p("jarFile: " + jarFile);
jarEntry = jarFile.getEntry(location[1]);
- // p("jarEntry name: " + jarEntry.getName());
stream = jarFile.getInputStream(jarEntry);
parseTLD(location[0], stream);
// FIXME @@@
@@ -240,6 +234,10 @@
// it to release the cached entry, so
// there's no way to redeploy from the same JAR file. Wierd.
} catch (Exception ex) {
+ Constants.message(
+ "jsp.error.taglib.jarFileException",
+ new Object[] {url.toString(), ex.getMessage()},
+ Logger.ERROR);
if (stream != null) {
try {
stream.close();
1.5 +24 -3
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/XmlOutputter.java
Index: XmlOutputter.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/XmlOutputter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XmlOutputter.java 2000/10/27 21:23:35 1.4
+++ XmlOutputter.java 2000/12/08 20:45:13 1.5
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/XmlOutputter.java,v
1.4 2000/10/27 21:23:35 pierred Exp $
- * $Revision: 1.4 $
- * $Date: 2000/10/27 21:23:35 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/XmlOutputter.java,v
1.5 2000/12/08 20:45:13 pierred Exp $
+ * $Revision: 1.5 $
+ * $Date: 2000/12/08 20:45:13 $
*
* ====================================================================
*
@@ -92,6 +92,12 @@
*/
private AttributesImpl rootAttrs;
+ /*
+ * Tells the nesting level of <jsp:root> tags encountered
+ * in the translation unit.
+ */
+ private int jspRootLevel = 0;
+
//*********************************************************************
// Constructor
@@ -110,11 +116,26 @@
* <jsp:root> tag.
*/
void addRootAttrs(Attributes attrs) {
+ jspRootLevel++;
int attrsLength = attrs.getLength();
for (int i = 0; i < attrsLength; i++) {
+ String qName = attrs.getQName(i);
+ if (attrs.getQName(i).startsWith("xmlns:jsp")
+ && jspRootLevel > 1) continue;
rootAttrs.addAttribute(attrs.getURI(i), attrs.getLocalName(i),
attrs.getQName(i), attrs.getType(i), attrs.getValue(i));
}
+ }
+
+ /*
+ * Only put the </jsp:root> tag when we're dealing
+ * with the top level 'container' page.
+ */
+ void rootEnd() {
+ jspRootLevel--;
+ if (jspRootLevel == 0) {
+ append("jsp:root");
+ }
}
/**