kinman 01/11/20 17:57:19
Modified: jasper/src/share/org/apache/jasper/compiler Parser.java
jasper/src/share/org/apache/jasper/resources
messages.properties messages_es.properties
messages_ja.properties
Log:
PR: 4940
-- Issue error if reserved taglib prefixes are used in taglib directives.
Revision Changes Path
1.17 +13 -1
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/Parser.java
Index: Parser.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/Parser.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Parser.java 2001/10/19 01:42:36 1.16
+++ Parser.java 2001/11/21 01:57:19 1.17
@@ -187,6 +187,10 @@
new JspUtil.ValidAttribute ("prefix", true)
};
+ private static final String[] reservedPrefixes = {
+ "jsp", "jspx", "java", "javax", "servlet", "sun", "sunw"
+ };
+
public boolean accept(ParseEventListener listener, JspReader reader,
Parser parser) throws JasperException
{
@@ -224,9 +228,17 @@
else if (match.equals("include"))
JspUtil.checkAttributes ("Include directive", attrs,
includeDvalidAttrs, start);
- else if (match.equals("taglib"))
+ else if (match.equals("taglib")) {
JspUtil.checkAttributes ("Taglib directive", attrs,
tagDvalidAttrs, start);
+ String prefix = attrs.getValue("prefix");
+ for (int i = 0; i < reservedPrefixes.length; i++) {
+ if (prefix.equals(reservedPrefixes[i]))
+ throw new ParseException(reader.mark(),
+ Constants.getString("jsp.error.taglib.reserved.prefix",
+ new Object[] { prefix }));
+ }
+ }
// Match close.
reader.skipSpaces();
1.22 +2 -1
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/resources/messages.properties
Index: messages.properties
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/resources/messages.properties,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- messages.properties 2001/10/03 21:48:30 1.21
+++ messages.properties 2001/11/21 01:57:19 1.22
@@ -1,4 +1,4 @@
-# $Id: messages.properties,v 1.21 2001/10/03 21:48:30 kinman Exp $
+# $Id: messages.properties,v 1.22 2001/11/21 01:57:19 kinman Exp $
#
# Default localized string information
# Localized this the Default Locale as is en_US
@@ -236,6 +236,7 @@
jspx.error.templateDataNotInJspCdata=Validation Error: Element <{0}> cannot
have template data. Template data must be encapsulated within a <jsp:text>
element. [JSP1.2 PFD section 5.1.9]\nTemplate data in error: {1}
#Error while processing taglib jar file {0}: {1}
jsp.error.taglib.jarFileException=
+jsp.error.taglib.reserved.prefix=The taglib prefix {0} is reserved
jsp.error.invalid.javaEncoding=Invalid java encodings. Tried {0} and then {1}. Both
failed.
jsp.error.needAlternateJavaEncoding=Default java encoding {0} is invalid on your
java platform. An alternate can be specified via the 'javaEncoding' parameter of
JspServlet.
#Error when compiling, used for jsp line number error messages
1.9 +2 -1
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/resources/messages_es.properties
Index: messages_es.properties
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/resources/messages_es.properties,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- messages_es.properties 2001/09/07 17:57:46 1.8
+++ messages_es.properties 2001/11/21 01:57:19 1.9
@@ -1,4 +1,4 @@
-# $Id: messages_es.properties,v 1.8 2001/09/07 17:57:46 craigmcc Exp $
+# $Id: messages_es.properties,v 1.9 2001/11/21 01:57:19 kinman Exp $
#
# Default localized string information
# Localized para Locale es_ES
@@ -194,6 +194,7 @@
jsp.error.library.invalid=
jsp.warning.tlvclass.is.null=No se puedee cargar la clase TagLibraryValidator
llamada {0}: {1}
jsp.error.taglibraryvalidator.invalidpage=
+jsp.error.taglib.reserved.prefix=
jsp.parser.sax.propertynotsupported=
jsp.parser.sax.propertynotrecognized=
jsp.parser.sax.featurenotsupported=
1.5 +2 -1
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/resources/messages_ja.properties
Index: messages_ja.properties
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/resources/messages_ja.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- messages_ja.properties 2001/10/12 08:13:26 1.4
+++ messages_ja.properties 2001/11/21 01:57:19 1.5
@@ -1,4 +1,4 @@
-# $Id: messages_ja.properties,v 1.4 2001/10/12 08:13:26 remm Exp $
+# $Id: messages_ja.properties,v 1.5 2001/11/21 01:57:19 kinman Exp $
#
# Default localized string information
# Localized this the Default Locale as is ja_JP
@@ -232,6 +232,7 @@
jspx.error.templateDataNotInJspCdata=\u8a3c\u660e\u30a8\u30e9\u30fc:
\u8981\u7d20<{0}>\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30c7\u30fc\u30bf\u3092\u6301\u3064\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30c7\u30fc\u30bf\u306f\u3001<jsp:text>\u8981\u7d20\u306e\u4e2d\u3067\u96a0\u853d\u3055\u308c\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002[JSP1.2
PFD
5.1.9]\n\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30c7\u30fc\u30bf\u306e\u30a8\u30e9\u30fc\u3067\u3059:
{1}
#Error while processing taglib jar file {0}: {1}
jsp.error.taglib.jarFileException=
+jsp.error.taglib.reserved.prefix=
jsp.error.unterminated.user.tag=\u7d42\u4e86\u3057\u3066\u3044\u306a\u3044\u30e6\u30fc\u30b6\u5b9a\u7fa9\u30bf\u30b0:
\u7d42\u4e86\u30bf\u30b0 {0}
\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u304b\u3001\u30cd\u30b9\u30c8\u306e\u9593\u9055\u3044\u3067\u3059\u3002
jsp.error.invalid.javaEncoding=\u7121\u52b9\u306aJava\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u3059\u3002{0}\u3092\u8a66\u3057\u3066\u3001\u305d\u308c\u304b\u3089{1}\u3092\u8a66\u3057\u307e\u3057\u305f\u304c\u3001\u4e21\u65b9\u304c\u5931\u6557\u3057\u307e\u3057\u305f
jsp.error.needAlternateJavaEncoding=\u30c7\u30d5\u30a9\u30eb\u30c8\u306eJava\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0
{0}
\u306f\u3042\u306a\u305f\u306e\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3067\u306f\u7121\u52b9\u3067\u3059\u3002JspServlet\u306e
'javaEncoding'
\u30d1\u30e9\u30e1\u30bf\u3067\u3001\u5225\u306e\u5024\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>