tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Lubke <Ryan.Lu...@Sun.COM>
Subject [Fwd: [PATCH - Jasper2] Minor compliance fix and some resource bundle key fixes]
Date Fri, 28 Jun 2002 00:32:58 GMT
Reposting messages.patch

-----Forwarded Message-----

From: Ryan Lubke <Ryan.Lubke@sun.com>
To: tcdev <tomcat-dev@jakarta.apache.org>
Subject: [PATCH - Jasper2] Minor compliance fix and some resource bundle key fixes
Date: 27 Jun 2002 19:30:55 -0500

Hi.

Two fixes:


1.  JspDocumentParser -  Enforce the fact that relative taglib URI's
    (those that start with "/") are prefixed by urn:jsptld:.

    See section 5.3.5 of the 1.2 spec, as well as the examples on
    page 92.

    I've added the failure message to messages.properties and
    messages_es.properties.  Can someone point me to some online
    tool that can do the necessary conversion for the
messages_ja.properties?

2.  During testing of the above patch using Watchdog, some resource 
    bundle key lookups failed.  

    I've corrected the keys in Validator.java based on those found in
    the resource bundles.

Thanks,

-rl


----


Index: Validator.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
retrieving revision 1.10
diff -u -r1.10 Validator.java
--- Validator.java	20 Jun 2002 23:48:23 -0000	1.10
+++ Validator.java	27 Jun 2002 23:21:56 -0000
@@ -138,14 +138,14 @@
 
 		if ("language".equals(attr)) {
 		    if (languageSeen)
-			err.jspError(n, "jsp.error.language.multiple");
+			err.jspError(n, "jsp.error.page.multiple.language");
 		    languageSeen = true;
 		    if (!"java".equalsIgnoreCase(value))
 			err.jspError(n, "jsp.error.language.nonjava");
 		    pageInfo.setLanguage(value);
 		} else if ("extends".equals(attr)) {
 		    if (extendsSeen)
-			err.jspError(n, "jsp.error.extends.multiple");
+			err.jspError(n, "jsp.error.page.multiple.extends");
 		    extendsSeen = true;
 		    pageInfo.setExtends(value);
 		    /*
@@ -158,7 +158,7 @@
 			n.addImport(value);
 		} else if ("contentType".equals(attr)) {
 		    if (contentTypeSeen) 
-			err.jspError(n, "jsp.error.contentType.multiple");
+			err.jspError(n, "jsp.error.page.multiple.contenttypes");
 		    contentTypeSeen = true;
 		    pageInfo.setContentType(value);
 		} else if ("session".equals(attr)) {
@@ -173,7 +173,7 @@
 			err.jspError(n, "jsp.error.session.invalid");
 		} else if ("buffer".equals(attr)) {
 		    if (bufferSeen)
-			err.jspError(n, "jsp.error.buffer.multiple");
+			err.jspError(n, "jsp.error.page.multiple.buffer");
 		    bufferSeen = true;
 
 		    if ("none".equalsIgnoreCase(value))
@@ -192,7 +192,7 @@
 		    }
 		} else if ("autoFlush".equals(attr)) {
 		    if (autoFlushSeen)
-			err.jspError(n, "jsp.error.autoFlush.multiple");
+			err.jspError(n, "jsp.error.page.multiple.autoflush");
 		    autoFlushSeen = true;
 		    if ("true".equalsIgnoreCase(value))
 			pageInfo.setAutoFlush(true);
@@ -202,7 +202,7 @@
 			err.jspError(n, "jsp.error.autoFlush.invalid");
 		} else if ("isthreadSafe".equals(attr)) {
 		    if (isThreadSafeSeen)
-			err.jspError(n, "jsp.error.isThreadSafe.multiple");
+			err.jspError(n, "jsp.error.page.multiple.threadsafe");
 		    isThreadSafeSeen = true;
 		    if ("true".equalsIgnoreCase(value))
 			pageInfo.setThreadSafe(true);
@@ -212,7 +212,7 @@
 			err.jspError(n, "jsp.error.isThreadSafe.invalid");
 		} else if ("isErrorPage".equals(attr)) {
 		    if (isErrorPageSeen)
-			err.jspError(n, "jsp.error.isErrorPage.multiple");
+			err.jspError(n, "jsp.error.page.multiple.iserrorpage");
 		    isErrorPageSeen = true;
 		    if ("true".equalsIgnoreCase(value))
 			pageInfo.setIsErrorPage(true);
@@ -222,7 +222,7 @@
 			err.jspError(n, "jsp.error.isErrorPage.invalid");
 		} else if ("errorPage".equals(attr)) {
 		    if (errorPageSeen) 
-			err.jspError(n, "jsp.error.errorPage.multiple");
+			err.jspError(n, "jsp.error.page.multiple.errorpage");
 		    errorPageSeen = true;
 		    pageInfo.setErrorPage(value);
 		} else if ("info".equals(attr)) {
@@ -231,7 +231,7 @@
 		    infoSeen = true;
 		} else if ("pageEncoding".equals(attr)) {
 		    if (pageEncodingSeen) 
-			err.jspError(n, "jsp.error.pageEncoding.multiple");
+			err.jspError(n, "jsp.error.page.multiple.pageencoding");
 		    pageEncodingSeen = true;
 		    pageInfo.setPageEncoding(value);
 		}
----


Index: JspDocumentParser.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
retrieving revision 1.3
diff -u -r1.3 JspDocumentParser.java
--- JspDocumentParser.java	20 Jun 2002 23:02:16 -0000	1.3
+++ JspDocumentParser.java	27 Jun 2002 23:04:08 -0000
@@ -434,6 +434,15 @@
 
 		// get the uri
 		String uri = attrs.getValue(i);
+
+        // make sure that a relative path is prefixed
+        // with urn:jsptld:path
+        if (uri.charAt(0) == '/') {
+            throw new JasperException(
+                err.getString("jsp.error.xml.taglib.uri.not_prefixed",
+                              uri));
+        }
+
 		if (uri.startsWith(URN_JSPTLD)) {
 		    // uri value is of the form "urn:jsptld:path"
 		    uri = uri.substring(URN_JSPTLD.length());
----


Index: messages_es.properties
===================================================================
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_es.properties,v
retrieving revision 1.2
diff -u -r1.2 messages_es.properties
--- messages_es.properties	26 Jun 2002 16:50:38 -0000	1.2
+++ messages_es.properties	27 Jun 2002 23:29:23 -0000
@@ -106,6 +106,7 @@
 jsp.warning.unknown.element.in.TLD=Aviso: Elemento {0} desconocido en el TLD
 jsp.warning.unknown.element.in.tag=Aviso: Elemento {0} desconocido en el tag
 jsp.warning.unknown.element.in.attribute=Aviso: Elemento {0} desconocido en el atributo
+jsp.error.xml.taglib.uri.not_prefixed=El URI relativo {0} se debe prefijar por \"urn:jsptld:\"
 jsp.error.more.than.one.taglib=Mas de una libreria de tags en el TLD: {0}
 jsp.warning.teiclass.is.null=No se puedee cargar la clase TagExtraInfo llamada {0}: {1}
 jsp.error.parse.error.in.TLD=Error de analisis en el descriptor de libreria de tags: {0}
----


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message