luehe 2002/12/16 11:43:54
Modified: jasper2/src/share/org/apache/jasper/resources
messages.properties
jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
Log:
Fixed 15404: No error condition raised if mandatory TLD elements
<jsp-version> and <tlib-version> are not present in the TLD
Revision Changes Path
1.72 +2 -1
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties
Index: messages.properties
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- messages.properties 13 Dec 2002 16:27:43 -0000 1.71
+++ messages.properties 16 Dec 2002 19:43:53 -0000 1.72
@@ -280,6 +280,7 @@
jsp.error.tld.fn.invalid.signature.parenexpected=Invalid syntax for function
signature in TLD. Parenthesis '(' expected. Tag Library: {0}, Function: {1}.
jsp.error.dynamic.attributes.not.implemented=The {0} tag declares that it accepts
dynamic attributes but does not implement the required interface
jsp.error.nomatching.fragment=Cannot find an attribute directive (with name={0} and
fragment=true) prior to the fragment directive.
+jsp.error.tld.mandatory.element.missing=Mandatory TLD element missing: {0}
jsp.error.attribute.noequal=equal symbol expected
jsp.error.attribute.noquote=quote symbol expected
jsp.error.attribute.unterminated=attribute for {0} is not properly terminated
1.29 +22 -9
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java
Index: TagLibraryInfoImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- TagLibraryInfoImpl.java 12 Dec 2002 17:44:38 -0000 1.28
+++ TagLibraryInfoImpl.java 16 Dec 2002 19:43:53 -0000 1.29
@@ -244,7 +244,9 @@
Vector tagVector = new Vector();
Vector tagFileVector = new Vector();
Hashtable functionTable = new Hashtable();
-
+ boolean tlibVersionSeen = false;
+ boolean jspVersionSeen = false;
+
// Create an iterator over the child elements of our <taglib> element
ParserUtils pu = new ParserUtils();
TreeNode tld = pu.parseXMLDocument(uri, in);
@@ -256,13 +258,15 @@
TreeNode element = (TreeNode) list.next();
String tname = element.getName();
- if ("tlibversion".equals(tname) || // JSP 1.1
- "tlib-version".equals(tname)) // JSP 1.2
+ if ("tlibversion".equals(tname) // JSP 1.1
+ || "tlib-version".equals(tname)) { // JSP 1.2
this.tlibversion = element.getBody();
- else if ("jspversion".equals(tname) ||
- "jsp-version".equals(tname))
+ tlibVersionSeen = true;
+ } else if ("jspversion".equals(tname)
+ || "jsp-version".equals(tname)) {
this.jspversion = element.getBody();
- else if ("shortname".equals(tname) ||
+ jspVersionSeen = true;
+ } else if ("shortname".equals(tname) ||
"short-name".equals(tname))
this.shortname = element.getBody();
else if ("uri".equals(tname))
@@ -301,6 +305,15 @@
}
}
+
+ if (!tlibVersionSeen) {
+ err.jspError("jsp.error.tld.mandatory.element.missing",
+ "tlib-version");
+ }
+ if (!jspVersionSeen) {
+ err.jspError("jsp.error.tld.mandatory.element.missing",
+ "jsp-version");
+ }
this.tags = new TagInfo[tagVector.size()];
tagVector.copyInto (this.tags);
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>