luehe 2003/02/13 17:36:32 Modified: jasper2/src/share/org/apache/jasper/compiler Validator.java jasper2/src/share/org/apache/jasper/resources messages.properties Log: Report translation error if both 'tagdir' and 'uri' are specified in taglib directive Revision Changes Path 1.77 +10 -6 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java Index: Validator.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- Validator.java 13 Feb 2003 22:48:44 -0000 1.76 +++ Validator.java 14 Feb 2003 01:36:32 -0000 1.77 @@ -467,10 +467,14 @@ public void visit(Node.TaglibDirective n) throws JasperException { JspUtil.checkAttributes("Taglib directive", n, taglibDirectiveAttrs, err); - // Either 'uri' or 'tagdir' attribute must be present - if (n.getAttributeValue("uri") == null - && n.getAttributeValue("tagdir") == null) { + // Either 'uri' or 'tagdir' attribute must be specified + String uri = n.getAttributeValue("uri"); + String tagdir = n.getAttributeValue("tagdir"); + if (uri == null && tagdir == null) { err.jspError(n, "jsp.error.taglibDirective.missing.location"); + } + if (uri != null && tagdir != null) { + err.jspError(n, "jsp.error.taglibDirective.both_uri_and_tagdir"); } } 1.94 +3 -2 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.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- messages.properties 13 Feb 2003 23:26:42 -0000 1.93 +++ messages.properties 14 Feb 2003 01:36:32 -0000 1.94 @@ -263,7 +263,8 @@ tld.error.variableNotAllowed=It is an error for a tag that has one or more variable subelements to have a TagExtraInfo class that returns a non-null object. jsp.error.tldInWebDotXmlNotFound=Could not locate TLD {1} for URI {0} specified in web.xml jsp.error.taglibDirective.absUriCannotBeResolved=The absolute uri: {0} cannot be resolved in either web.xml or the jar files deployed with this application -jsp.error.taglibDirective.missing.location=Neither 'uri' nor 'tagdir' attribute specified in taglib directive +jsp.error.taglibDirective.missing.location=Neither \'uri\' nor \'tagdir\' attribute specified +jsp.error.taglibDirective.both_uri_and_tagdir=Both \'uri\' and \'tagdir\' attributes specified jsp.error.invalid.tagdir=Tag file directory {0} does not start with \"/WEB-INF/tags\" jsp.error.unterminated.user.tag=Unterminated user-defined tag: ending tag {0} not found or incorrectly nested #jspx.error.templateDataNotInJspCdata=Validation Error: Element <{0}> cannot have template data. Template data must be encapsulated within a <jsp:cdata> element. [JSP1.2 PFD section 5.1.9]\nTemplate data in error: {1}
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]