luehe 2002/08/01 14:17:58 Modified: jasper2/src/share/org/apache/jasper/compiler PageDataImpl.java TagLibraryInfoImpl.java Validator.java jasper2/src/share/org/apache/jasper/resources messages_es.properties messages_ja.properties Log: Implemented taglib directive changes: - 'uri' attribute is no longer considered mandatory. - Use new 'tagdir' attribute if present. Revision Changes Path 1.6 +9 -5 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java Index: PageDataImpl.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- PageDataImpl.java 22 Jul 2002 23:02:55 -0000 1.5 +++ PageDataImpl.java 1 Aug 2002 21:17:58 -0000 1.6 @@ -209,10 +209,14 @@ public void visit(Node.TaglibDirective n) throws JasperException { Attributes attrs = n.getAttributes(); if (attrs != null) { - String uri = attrs.getValue("uri"); + String location = attrs.getValue("uri"); + if (location == null) { + // JSP 2.0 CLARIFICATION NEEDED + location = attrs.getValue("tagdir"); + } String prefix = attrs.getValue("prefix"); rootAttrs.addAttribute("", "", "xmlns:" + prefix, "CDATA", - uri); + location); } } } 1.9 +3 -23 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.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- TagLibraryInfoImpl.java 31 Jul 2002 21:42:27 -0000 1.8 +++ TagLibraryInfoImpl.java 1 Aug 2002 21:17:58 -0000 1.9 @@ -467,7 +467,6 @@ } TagAttributeInfo createAttribute(TreeNode elem) { - // p("createAttribute\n" + elem); String name = null; boolean required = false, rtexprvalue = false, reqTime = false; String type = null; @@ -500,8 +499,6 @@ } } - // p("name=" + name + ", required=" + required + ", type=" + type + - // ", rtexprvalue=" + rtexprvalue); return new TagAttributeInfo(name, required, type, rtexprvalue); } @@ -642,7 +639,6 @@ Class tlvClass = ctxt.getClassLoader().loadClass(validatorClass); tlv = (TagLibraryValidator)tlvClass.newInstance(); - //p("got validator class: " + tlv); } catch (Exception ex) { Constants.message("jsp.warning.tlvclass.is.null", new Object[] { @@ -712,18 +708,6 @@ return new FunctionInfo(name, klass, signature); } -/* - static void copy(InputStream in, String fileName) - throws IOException, FileNotFoundException - { - byte[] buf = new byte[1024]; - - FileOutputStream out = new FileOutputStream(fileName); - int nRead; - while ((nRead = in.read(buf, 0, buf.length)) != -1) - out.write(buf, 0, nRead); - } -*/ //********************************************************************* // Until javax.servlet.jsp.tagext.TagLibraryInfo is fixed @@ -753,8 +737,4 @@ } protected TagLibraryValidator tagLibraryValidator; - - private void p(String s) { - System.out.println("[TagLibraryInfoImpl] " + s); - } } 1.17 +12 -4 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.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Validator.java 31 Jul 2002 21:42:27 -0000 1.16 +++ Validator.java 1 Aug 2002 21:17:58 -0000 1.17 @@ -334,7 +334,8 @@ new JspUtil.ValidAttribute("file", true) }; private static final JspUtil.ValidAttribute[] taglibDirectiveAttrs = { - new JspUtil.ValidAttribute("uri", true), + new JspUtil.ValidAttribute("uri"), + new JspUtil.ValidAttribute("tagdir"), new JspUtil.ValidAttribute("prefix", true) }; private static final JspUtil.ValidAttribute[] includeActionAttrs = { @@ -410,6 +411,11 @@ 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) { + err.jspError(n, "jsp.error.taglibDirective.missing.location"); + } } public void visit(Node.ParamAction n) throws JasperException { @@ -924,6 +930,8 @@ Enumeration enum = compiler.getPageInfo().getTagLibraries().elements(); while (enum.hasMoreElements()) { TagLibraryInfo tli = (TagLibraryInfo) enum.nextElement(); + if (!(tli instanceof TagLibraryInfoImpl)) + continue; ValidationMessage[] errors = ((TagLibraryInfoImpl) tli).validate(xmlView); if ((errors != null) && (errors.length != 0)) { 1.5 +2 -1 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_es.properties 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.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- messages_es.properties 31 Jul 2002 16:04:39 -0000 1.4 +++ messages_es.properties 1 Aug 2002 21:17:58 -0000 1.5 @@ -209,3 +209,4 @@ jsp.error.parse.xml.invalidPublicId= jsp.error.usebean.notinsamefile=El tag useBean debe empezar y acabar en el mismo archivo fisico jsp.error.invalid.attribute= +jsp.error.taglibDirective.missing.location= 1.4 +2 -1 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_ja.properties Index: messages_ja.properties =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_ja.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- messages_ja.properties 31 Jul 2002 16:04:39 -0000 1.3 +++ messages_ja.properties 1 Aug 2002 21:17:58 -0000 1.4 @@ -241,3 +241,4 @@ jsp.error.single.line.number=\n\nJSP\u30d5\u30a1\u30a4\u30eb: {1} \u306e\u4e2d\u306e\u884c: {0}\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\n\n jsp.error.multiple.line.number=\n\nJPS\u30d5\u30a1\u30a4\u30eb: {2}\u306e\u4e2d\u306e{0}\u884c\u76ee\u3068{1}\u884c\u76ee\u306e\u9593\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\n\n jsp.error.corresponding.servlet=\u751f\u6210\u3055\u308c\u305f\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u306e\u30a8\u30e9\u30fc\u3067\u3059:\n +jsp.error.taglibDirective.missing.location=
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>