Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 54951 invoked from network); 30 Jul 2002 23:01:37 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 30 Jul 2002 23:01:37 -0000 Received: (qmail 4975 invoked by uid 97); 30 Jul 2002 23:00:21 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 4885 invoked by uid 97); 30 Jul 2002 23:00:19 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 4874 invoked by uid 97); 30 Jul 2002 23:00:19 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 30 Jul 2002 22:59:48 -0000 Message-ID: <20020730225948.81765.qmail@icarus.apache.org> From: kinman@apache.org To: jakarta-servletapi-5-cvs@apache.org Subject: cvs commit: jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext JspTag.java TagFileInfo.java DynamicAttributes.java SimpleTag.java SimpleTagSupport.java Tag.java TagAdapter.java TagData.java TagExtraInfo.java TagInfo.java TagLibraryInfo.java TagLibraryValidator.java TagVariableInfo.java ValidationMessage.java VariableInfo.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N kinman 2002/07/30 15:59:47 Modified: src/share/dtd jspxml.dtd jspxml.xsd src/share/javax/servlet/jsp/el ExpressionEvaluator.java src/share/javax/servlet/jsp/tagext DynamicAttributes.java SimpleTag.java SimpleTagSupport.java Tag.java TagAdapter.java TagData.java TagExtraInfo.java TagInfo.java TagLibraryInfo.java TagLibraryValidator.java TagVariableInfo.java ValidationMessage.java VariableInfo.java Added: src/share/dtd j2ee_1_4.xsd jsp_2_0.xsd web-app_2_4.xsd web-jsptaglibrary_2_0.xsd src/share/javax/servlet/jsp/tagext JspTag.java TagFileInfo.java Removed: src/share/dtd web-jsptaglibrary_2_0.dtd Log: - Applied patch by Patrick Luby: updates all of the "Servlet 2.3" references to "Servlet 2.4" and "JSP 1.2" references to "JSP 2.0". - Applied patch by Mark Roth: latest JSP 2.0 APIs as of our latest Expert Group internal release of the specification. Notes: * Included as well are the latest XML Schema files for the JSP portion of the deployment descriptor and the Tag Library Descriptor. This obsoletes src/share/dtd/web-jsptaglibrary_2_0.dtd. * This patch includes the following file additions: * src/share/dtd/j2ee_1_4.xsd * src/share/dtd/jsp_2_0.xsd * src/share/dtd/web-app_2_4.xsd * src/share/dtd/web-jsptaglibrary_2_0.xsd * src/share/javax/servlet/jsp/tagext/JspTag.java * src/share/javax/servlet/jsp/tagext/TagFileInfo.java * The Servlet 2.4 Specification lead told me there are more updates to web-app_2_4.xsd on the way. Stay tuned. Revision Changes Path 1.2 +9 -0 jakarta-servletapi-5/src/share/dtd/jspxml.dtd Index: jspxml.dtd =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/dtd/jspxml.dtd,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jspxml.dtd 16 Jul 2002 16:38:40 -0000 1.1 +++ jspxml.dtd 30 Jul 2002 22:59:45 -0000 1.2 @@ -77,6 +77,12 @@ > + @@ -83,20 +75,6 @@ - - - - - - @@ -323,10 +301,13 @@ directive.page is the "page directive". + The contentType default is not relevant for XML views of + JSP pages since it differs depending on the originating + syntax (text/html;ISO-8859-1 for JSP Pages in standard syntax, or + text/xml;UTF-8 for JSP Documents in XML syntax. - @@ -339,6 +320,8 @@ + + @@ -350,12 +333,11 @@ - - + The representation of a scriplet. @@ -363,7 +345,7 @@ - + The reprsentation of a declaration. @@ -371,7 +353,7 @@ - + The representation of an expression. @@ -379,7 +361,7 @@ - + Verbatim template text. @@ -401,7 +383,6 @@ - @@ -432,7 +413,6 @@ - @@ -455,7 +435,6 @@ - @@ -466,7 +445,6 @@ - @@ -477,7 +455,6 @@ - @@ -488,7 +465,6 @@ - @@ -514,13 +490,11 @@ - - 1.1 jakarta-servletapi-5/src/share/dtd/j2ee_1_4.xsd Index: j2ee_1_4.xsd =================================================================== @(#)j2ee_1_4.xsds 1.20 02/07/12 Copyright 2002 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California 94303, U.S.A. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and other countries. This document and the technology which it describes are distributed under licenses restricting their use, copying, distribution, and decompilation. No part of this document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE, JavaServer Pages, Enterprise JavaBeans and the Java Coffee Cup logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Federal Acquisitions: Commercial Software - Government Users Subject to Standard License Terms and Conditions. The following definitions that appear in the common shareable schema(s) of J2EE deployment descriptors should be interpreted with respect to the context they are included: Deployment Component may indicate one of the following: j2ee application; application client; web application; enterprise bean; resource adapter; Deployment File may indicate one of the following: ear file; war file; jar file; rar file; The deployment-extensionType is used to indicate extensions to the specific Deployment Component. It is used by deployment-extension elements to designate an extension block that is targeted to a specific extension designated by a set of extension elements that are declared by a namespace. The namespace identifies the extension to the deployment tool that processes the extension. The mustUnderstand attribute is provided by the Application Assembler to indicate whether the extension described is an essential extension that must exist in the container. If mustUnderstand is "true", the deployment tool must indicate an error when processing a deployment-extension element with a namespace it does not understand. Extensions that are not essential are declared by default as optional extensions that need not be provided by a container. Applications that use such extensions are portable to other containers because deployment tools will ignore extensions that they don't support. The type of the extension-element is abstract. Therefore, a concrete type must be specified by the deployment descriptor using xsi:type attribute for each extension-element. The value of the mustUnderstand attribute is "false" by default. The description type is used by a description element to provide text describing the parent element. The elements that use this type should include any information that the Deployment Component's Deployment File file producer wants to provide to the consumer of the Deployment Component's Deployment File (i.e., to the Deployer). Typically, the tools used by such a Deployment File consumer will display the description when processing the parent element that contains the description. The lang attribute defines the language that the description is provided in. The default value is "en" (English). This type defines a dewey decimal which is used to describe versions of documents. The display-name type contains a short name that is intended to be displayed by tools. It is used by display-name elements. The display name need not be unique. Example: ... Employee Self Service The value of the xml:lang attribute is "en" (English) by default. The ejb-linkType is used by ejb-link elements in the ejb-ref or ejb-local-ref elements to specify that an EJB reference is linked to enterprise bean. The value of the ejb-link element must be the ejb-name of an enterprise bean in the same ejb-jar file or in another ejb-jar file in the same J2EE application unit. Alternatively, the name in the ejb-link element may be composed of a path name specifying the ejb-jar containing the referenced enterprise bean with the ejb-name of the target bean appended and separated from the path name by "#". The path name is relative to the Deployment File containing Deployment Component that is referencing the enterprise bean. This allows multiple enterprise beans with the same ejb-name to be uniquely identified. Examples: EmployeeRecord ../products/product.jar#ProductEJB The ejb-local-refType is used by ejb-local-ref elements for the declaration of a reference to an enterprise bean's local home. The declaration consists of: - an optional description - the EJB reference name used in the code of the Deployment Component that's referencing the enterprise bean - the expected type of the referenced enterprise bean - the expected local home and local interfaces of the referenced enterprise bean - optional ejb-link information, used to specify the referenced enterprise bean The ejb-ref-name element contains the name of an EJB reference. The EJB reference is an entry in the Deployment Component's environment and is relative to the java:comp/env context. The name must be unique within the Deployment Component. It is recommended that name is prefixed with "ejb/". Example: ejb/Payroll The ejb-ref-typeType contains the expected type of the referenced enterprise bean. The ejb-ref-type designates a value that must be one of the following: Entity Session The ejb-refType is used by ejb-ref elements for the declaration of a reference to an enterprise bean's home. The declaration consists of: - an optional description - the EJB reference name used in the code of the Deployment Component that's referencing the enterprise bean - the expected type of the referenced enterprise bean - the expected home and remote interfaces of the referenced enterprise bean - optional ejb-link information, used to specify the referenced enterprise bean This type is used to designate an empty element when used. This type contains the fully-qualified Java type of the environment entry value that is expected by the application's code. The following are the legal values of env-entry-type-valuesType: java.lang.Boolean java.lang.Byte java.lang.Character java.lang.String java.lang.Short java.lang.Integer java.lang.Long java.lang.Float java.lang.Double Example: java.lang.Boolean The env-entryType is used to declare an application's environment entry. The declaration consists of an optional description, the name of the environment entry, and an optional value. If a value is not specified, one must be supplied during deployment. It is used by env-entry elements. The env-entry-name element contains the name of a Deployment Component's environment entry. The name is a JNDI name relative to the java:comp/env context. The name must be unique within a Deployment Component. The uniqueness constraints must be defined within the declared context. Example: minAmount The env-entry-value designates the value of a Deployment Component's environment entry. The value must be a String that is valid for the constructor of the specified type that takes a single String parameter, or for java.lang.Character, a single character. Example: 100.00 The extensibleType is an abstract base type which is used to define the type of extension-elements. Instance documents must substitute a known type to define the extension by using xsi:type attribute to define the actual type of extension-elements. The elements that use this type designate the name of a Java class or interface. This type defines four different values which can designate boolean values. This includes values yes and no which are not designated by xsd:boolean The homeType defines the fully-qualified name of an enterprise bean's home interface. Example: com.aardvark.payroll.PayrollHome The icon type contains small-icon and large-icon elements that specify the file names for small and large GIF or JPEG icon images used to represent the parent element in a GUI tool. The xml:lang attribute defines the language that the icon file names are provided in. Its value is "en" (English) by default. The small-icon element contains the name of a file containing a small (16 x 16) icon image. The file name is a relative path within the Deployment Component's Deployment File. The image may be either in the JPEG or GIF format. The icon can be used by tools. Example: employee-service-icon16x16.jpg The large-icon element contains the name of a file containing a large (32 x 32) icon image. The file name is a relative path within the Deployment Component's Deployment File. The image may be either in the JPEG or GIF format. The icon can be used by tools. Example: employee-service-icon32x32.jpg The java-identifierType defines a Java identifier. The users of this type should further verify that the content does not contain Java reserved keywords. The jndi-nameType type designates a JNDI name in the Deployment Component's environment and is relative to the java:comp/env context. A JNDI name must be unique within the Deployment Component. The local-homeType defines the fully-qualified name of an enterprise bean's local home interface. The localType defines the fully-qualified name of an enterprise bean's local interface. The message-destination-linkType is used to link a message destination reference or message-driven bean to a message destination. The Assembler sets the value to reflect the flow of messages between producers and consumers in the application. The value must be the message-destination-name of a message destination in the same Deployment File or in another Deployment File in the same J2EE application unit. Alternatively, the value may be composed of a path name specifying a Deployment File containing the referenced message destination with the message-destination-name of the destination appended and separated from the path name by "#". The path name is relative to the Deployment File containing Deployment Component that is referencing the message destination. This allows multiple message destinations with the same name to be uniquely identified. The message-destination-ref element contains a declaration of Deployment Component's reference to a message destination associated with a resource in Deployment Component's environment. It consists of: - an optional description - the message destination reference name - the message destination type - a specification as to whether the destination is used for consuming or producing messages, or both - a link to the message destination Examples: jms/StockQueue javax.jms.Queue Consumes CorporateStocks The message-destination-ref-name element specifies the name of a message destination reference; its value is the environment entry name used in Deployment Component code. The name is a JNDI name relative to the java:comp/env context and must be unique within an ejb-jar (for enterprise beans) or a Deployment File (for others). %%% The message-destination-typeType specifies the type of the destination. The type is specified by the Java interface expected to be implemented by the destination. Example: javax.jms.Queue The message-destination-usageType specifies the use of the message destination indicated by the reference. The value indicates whether messages are consumed from the message destination, produced for the destination, or both. The Assembler makes use of this information in linking producers of a destination with its consumers. The value of the message-destination-usage element must be one of the following: Consumes Produces ConsumesProduces The message-destinationType specifies a message destination. The logical destination described by this element is mapped to a physical destination by the Deployer. The message destination element contains: - an optional description - an optional display-name - an optional icon - a message destination name which must be unique among message destination names within the same Deployment File. Example: CorporateStocks The message-destination-name element specifies a name for a message destination. This name must be unique among the names of message destinations within the Deployment File. This type is a general type that can be used to declare parameter/value lists. The param-name element contains the name of a parameter. The param-value element contains the value of a parameter. The elements that use this type designate either a relative path or an absolute path starting with a "/". In elements that specify a pathname to a file within the same Deployment File, relative filenames (i.e., those not starting with "/") are considered relative to the root of the Deployment File's namespace. Absolute filenames (i.e., those starting with "/") also specify names in the root of the Deployment File's namespace. In general, relative names are preferred. The exception is .war files where absolute names are preferred for consistency with the Servlet API. The remote element contains the fully-qualified name of the enterprise bean's remote interface. Example: com.wombat.empl.EmployeeService The res-authType specifies whether the Deployment Component code signs on programmatically to the resource manager, or whether the Container will sign on to the resource manager on behalf of the Deployment Component. In the latter case, the Container uses information that is supplied by the Deployer. The value must be one of the two following: Application Container The res-sharing-scope type specifies whether connections obtained through the given resource manager connection factory reference can be shared. The value, if specified, must be one of the two following: Shareable Unshareable The default value is Shareable. The resource-env-refType is used to define resource-env-type elements. It contains a declaration of a Deployment Component's reference to an administered object associated with a resource in the Deployment Component's environment. It consists of an optional description, the resource environment reference name, and an indication of the resource environment reference type expected by the Deployment Component code. Example: jms/StockQueue javax.jms.Queue The resource-env-ref-name element specifies the name of a resource environment reference; its value is the environment entry name used in the Deployment Component code. The name is a JNDI name relative to the java:comp/env context and must be unique within a Deployment Component. The resource-env-ref-type element specifies the type of a resource environment reference. It is the fully qualified name of a Java language class or interface. The resource-refType contains a declaration of a Deployment Component's reference to an external resource. It consists of an optional description, the resource manager connection factory reference name, the indication of the resource manager connection factory type expected by the Deployment Component code, the type of authentication (Application or Container), and an optional specification of the shareability of connections obtained from the resource (Shareable or Unshareable). Example: jdbc/EmployeeAppDB javax.sql.DataSource Container Shareable The res-ref-name element specifies the name of a resource manager connection factory reference. The name is a JNDI name relative to the java:comp/env context. The name must be unique within a Deployment File. The res-type element specifies the type of the data source. The type is specified by the fully qualified Java language class or interface expected to be implemented by the data source. The role-nameType designates the name of a security role. The name must conform to the lexical rules for an NMTOKEN. The run-asType specifies the run-as identity to be used for the execution of a component. It contains an optional description, and the name of a security role. The security-role-refType contains the declaration of a security role reference in a component's or a Deployment Component's code. The declaration consists of an optional description, the security role name used in the code, and an optional link to a security role. If the security role is not specified, the Deployer must choose an appropriate security role. The value of the role-name element must be the String used as the parameter to the EJBContext.isCallerInRole(String roleName) method or the HttpServletRequest.isUserInRole(String role) method. The role-link element is a reference to a defined security role. The role-link element must contain the name of one of the security roles defined in the security-role elements. The security-roleType contains the definition of a security role. The definition consists of an optional description of the security role, and the security role name. Example: This role includes all employees who are authorized to access the employee service application. employee This is a special string datatype that is defined by J2EE as a base type for defining collapsed strings. When schemas require trailing/leading space elimination as well as collapsing the existing whitespace, this base type may be used. This simple type designates a boolean with only two permissible values - true - false The url-patternType contains the url pattern of the mapping. It must follow the rules specified in Section 11.2 of the Servlet API Specification. The elements that use this type designate a path starting with a "/" and interpreted relative to the root of a WAR file. 1.1 jakarta-servletapi-5/src/share/dtd/jsp_2_0.xsd Index: jsp_2_0.xsd =================================================================== @(#)jsp_2_0.xsds 1.8 07/29/02 Copyright 2002 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California 94303, U.S.A. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and other countries. This document and the technology which it describes are distributed under licenses restricting their use, copying, distribution, and decompilation. No part of this document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE, JavaServer Pages, Enterprise JavaBeans and the Java Coffee Cup logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Federal Acquisitions: Commercial Software - Government Users Subject to Standard License Terms and Conditions. This is the XML Schema for the JSP 2.0 deployment descriptor types. The JSP 2.0 schema contains all the special structures and datatypes that are necessary to use JSP files from a web application. The contents of this schema is used by the web-app_2_4.xsd file to define JSP specific content. The following conventions apply to all J2EE deployment descriptor elements unless indicated otherwise. - In elements that specify a pathname to a file within the same JAR file, relative filenames (i.e., those not starting with "/") are considered relative to the root of the JAR file's namespace. Absolute filenames (i.e., those starting with "/") also specify names in the root of the JAR file's namespace. In general, relative names are preferred. The exception is .war files where absolute names are preferred for consistency with the Servlet API. The jsp-configType is used to provide global configuration information for the JSP files in a web application. It has two subelements, taglib and jsp-property-group. The jsp-file element contains the full path to a JSP file within the web application beginning with a `/'. The jsp-property-groupType is used to group a number of files so they can be given global property information. All files so described are deemed to be JSP files. The following additional properties can be described: - Control enabling of EL evaluation. - Control enabling of Scripting elements. - Indicate pageEncoding information. - Prelude and Coda automatic includes. Can be used to easily set the isElEnabled property of a group of JSP pages. By default, the EL evaluation is enabled for Web Applications using a Servlet 2.4 or greater web.xml. The valid values of page-encoding are those of the pageEncoding page directive. It is a translation-time error to define the pageEncoding of a JSP page through one value in the JSP configuration element and then give it a different value in a pageEncoding directive, but it is legal to give it the same value. Can be used to easily set the isScriptingEnabled property of a group of JSP pages. By default, scripting is enabled. The include-prelude element is a context-relative path that must correspond to an element in the Web Application. When the element is present, the given path will be automatically included (as in an include directive) at the beginning of each JSP page in this jsp-property-group. The include-coda element is a context-relative path that must correspond to an element in the Web Application. When the element is present, the given path will be automatically included (as in an include directive) at the end of each JSP page in this jsp-property-group. A taglib can be used to provide information on a tag library that is used by a JSP page within the Web Application. A taglib-uri element describes a URI identifying a tag library used in the web application. The body of the taglib-uri element may be either an absolute URI specification, or a relative URI. There should be no entries in web.xml with the same taglib-uri value. the taglib-location element contains the location (as a resource relative to the root of the web application) where to find the Tag Library Description file for the tag library. 1.1 jakarta-servletapi-5/src/share/dtd/web-app_2_4.xsd Index: web-app_2_4.xsd =================================================================== @(#)web-app_2_4.xsds 1.32 02/07/26 Copyright 2002 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California 94303, U.S.A. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and other countries. This document and the technology which it describes are distributed under licenses restricting their use, copying, distribution, and decompilation. No part of this document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE, JavaServer Pages, Enterprise JavaBeans and the Java Coffee Cup logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Federal Acquisitions: Commercial Software - Government Users Subject to Standard License Terms and Conditions. This is the XML Schema for the Servlet 2.4 deployment descriptor. All Servlet deployment descriptors must indicate the web application schema by using the J2EE namespace: http://java.sun.com/xml/ns/j2ee and by indicating the version of the schema by using the version element as shown below: ... The instance documents may indicate the published version of the schema using the xsi:schemaLocation attribute for J2EE namespace with the following location: http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd The following conventions apply to all J2EE deployment descriptor elements unless indicated otherwise. - In elements that specify a pathname to a file within the same JAR file, relative filenames (i.e., those not starting with "/") are considered relative to the root of the JAR file's namespace. Absolute filenames (i.e., those starting with "/") also specify names in the root of the JAR file's namespace. In general, relative names are preferred. The exception is .war files where absolute names are preferred for consistency with the Servlet API. The web-app element is the root of the deployment descriptor for a web application. The servlet element contains the name of a servlet. The name must be unique within the web application. The filter element contains the name of a filter. The name must be unique within the web application. The ejb-local-ref-name element contains the name of an EJB reference. The EJB reference is an entry in the web application's environment and is relative to the java:comp/env context. The name must be unique within the web application. It is recommended that name is prefixed with "ejb/". The ejb-ref-name element contains the name of an EJB reference. The EJB reference is an entry in the web application's environment and is relative to the java:comp/env context. The name must be unique within the web application. It is recommended that name is prefixed with "ejb/". The resource-env-ref-name element specifies the name of a resource environment reference; its value is the environment entry name used in the web application code. The name is a JNDI name relative to the java:comp/env context and must be unique within a web application. The message-destination-ref-name element specifies the name of a message destination reference; its value is the environment entry name used in the web application code. The name is a JNDI name relative to the java:comp/env context and must be unique within a web application. The res-ref-name element specifies the name of a resource manager connection factory reference. The name is a JNDI name relative to the java:comp/env context. The name must be unique within a web application. The env-entry-name element contains the name of a web application's environment entry. The name is a JNDI name relative to the java:comp/env context. The name must be unique within a web application. A role-name-key is specified to allow the references from the security-role-refs. The keyref indicates the references from security-role-ref to a specified role-name. The auth-constraintType indicates the user roles that should be permitted access to this resource collection. The role-name used here must either correspond to the role-name of one of the security-role elements defined for this web application, or be the specially reserved role-name "*" that is a compact syntax for indicating all roles in the web application. If both "*" and rolenames appear, the container interprets this as all roles. If no roles are defined, no user is allowed access to the portion of the web application described by the containing security-constraint. The container matches role names case sensitively when determining access. The auth-methodType is used to configure the authentication mechanism for the web application. As a prerequisite to gaining access to any web resources which are protected by an authorization constraint, a user must have authenticated using the configured mechanism. Legal values are "BASIC", "DIGEST", "FORM", or "CLIENT-CERT". Used in: login-config The dispatcher has three legal values, FORWARD and REQUEST and INCLUDE. A value of FORWARD means the Filter will be applied under RequestDispatcher.forward() calls. A value of REQUEST means the Filter will be applied under ordinary client calls to the path or servlet. A value of INCLUDE means the Filter will be applied under RequestDispatcher.include() calls. The absence of any dispatcher elements in a filter-mapping indicates a default of applying filters only under ordinary client calls to the path or servlet. The error-code contains an HTTP error code, ex: 404 Used in: error-page The error-pageType contains a mapping between an error code or exception type to the path of a resource in the web application. Used in: web-app The exception-type contains a fully qualified class name of a Java exception type. The location element contains the location of the resource in the web application relative to the root of the web application. The value of the location must have a leading `/'. Declaration of the filter mappings in this web application is done by using filter-mappingType. The container uses the filter-mapping declarations to decide which filters to apply to a request, and in what order. The container matches the request URI to a Servlet in the normal way. To determine which filters to apply it matches filter-mapping declarations either on servlet-name, or on url-pattern for each filter-mapping element, depending on which style is used. The order in which filters are invoked is the order in which filter-mapping declarations that match a request URI for a servlet appear in the list of filter-mapping elements.The filter-name value must be the value of the filter-name sub-elements of one of the filter declarations in the deployment descriptor. The logical name of the filter is declare by using filter-nameType. This name is used to map the filter. Each filter name is unique within the web application. Used in: filter, filter-mapping The filterType is used to declare a filter in the web application. The filter is mapped to either a servlet or a URL pattern in the filter-mapping element, using the filter-name value to reference. Filters can access the initialization parameters declared in the deployment descriptor at runtime via the FilterConfig interface. Used in: web-app The fully qualified classname of the filter. The init-param element contains a name/value pair as an initialization param of a servlet filter The form-login-configType specifies the login and error pages that should be used in form based login. If form based authentication is not used, these elements are ignored. Used in: login-config The form-login-page element defines the location in the web app where the page that can be used for login can be found. The path begins with a leading / and is interpreted relative to the root of the WAR. The form-error-page element defines the location in the web app where the error page that is displayed when login is not successful can be found. The path begins with a leading / and is interpreted relative to the root of the WAR. The http-method contains an HTTP method recognized by the web-app, i.e. (GET | POST |...). The listenerType indicates the deployment properties for a web application listener bean. Used in: web-app:listenerType The listener-class element declares a class in the application must be registered as a web application listener bean. The value is the fully qualified classname of the listener class. The locale-encoding-mapping-list contains one or more locale-encoding-mapping(s). The locale-encoding-mapping contains locale name and encoding name. The locale name must be either "Language-code", such as "ja", defined by ISO-639 or "Language-code_Country-code", such as "ja_JP". "Country code" is defined by ISO-3166. The login-configType is used to configure the authentication method that should be used, the realm name that should be used for this application, and the attributes that are needed by the form login mechanism. Used in: web-app The realm name element specifies the realm name to use in HTTP Basic authorization. The mime-mappingType defines a mapping between an extension and a mime type. Used in: web-app The extension element contains a string describing an extension. example: "txt" The mime-typeType is used to indicate a defined mime type. Example: "text/plain" Used in: mime-mapping The security-constraintType is used to associate security constraints with one or more web resource collections Used in: web-app The servlet-mappingType defines a mapping between a servlet and a url pattern. Used in: web-app The servlet-name element contains the canonical name of the servlet. Each servlet name is unique within the web application. The servletType is used to declare a servlet. It contains the declarative data of a servlet. If a jsp-file is specified and the load-on-startup element is present, then the JSP should be precompiled and loaded. Used in: web-app The servlet-class element contains the fully qualified class name of the servlet. The load-on-startup element indicates that this servlet should be loaded (instantiated and have its init() called) on the startup of the web application. The optional contents of these element must be an integer indicating the order in which the servlet should be loaded. If the value is a negative integer, or the element is not present, the container is free to load the servlet whenever it chooses. If the value is a positive integer or 0, the container must load and initialize the servlet as the application is deployed. The container must guarantee that servlets marked with lower integers are loaded before servlets marked with higher integers. The container may choose the order of loading of servlets with the same load-on-start-up value. The session-configType defines the session parameters for this web application. Used in: web-app The session-timeout element defines the default session timeout interval for all sessions created in this web application. The specified timeout must be expressed in a whole number of minutes. If the timeout is 0 or less, the container ensures the default behaviour of sessions is never to time out. The transport-guaranteeType specifies that the communication between client and server should be NONE, INTEGRAL, or CONFIDENTIAL. NONE means that the application does not require any transport guarantees. A value of INTEGRAL means that the application requires that the data sent between the client and server be sent in such a way that it can't be changed in transit. CONFIDENTIAL means that the application requires that the data be transmitted in a fashion that prevents other entities from observing the contents of the transmission. In most cases, the presence of the INTEGRAL or CONFIDENTIAL flag will indicate that the use of SSL is required. Used in: user-data-constraint The user-data-constraintType is used to indicate how data communicated between the client and container should be protected. Used in: security-constraint This type contains the recognized versions of web-application supported. It is used to designate the version of the web application. Example: 2.4 ... The context-param element contains the declaration of a web application's servlet context initialization parameters. The web-resource-collectionType is used to identify a subset of the resources and HTTP methods on those resources within a web application to which a security constraint applies. If no HTTP methods are specified, then the security constraint applies to all HTTP methods. Used in: security-constraint The web-resource-name contains the name of this web resource collection. The welcome-file-list contains an ordered list of welcome files elements. Used in: web-app The welcome-file element contains file name to use as a default welcome file, such as index.html 1.1 jakarta-servletapi-5/src/share/dtd/web-jsptaglibrary_2_0.xsd Index: web-jsptaglibrary_2_0.xsd =================================================================== @(#)web-jsptaglibrary_2_0.xsds 1.10 07/29/02 Copyright 2002 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California 94303, U.S.A. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and other countries. This document and the technology which it describes are distributed under licenses restricting their use, copying, distribution, and decompilation. No part of this document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE, JavaServer Pages, Enterprise JavaBeans and the Java Coffee Cup logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Federal Acquisitions: Commercial Software - Government Users Subject to Standard License Terms and Conditions. This is the XML Schema for the JSP Taglibrary deployment descriptor. All Taglibrary deployment descriptors must indicate the tag library schema by using the Taglibrary namespace: http://java.sun.com/xml/ns/j2ee and by indicating the version of the schema by using the version element as shown below: ... The instance documents may indicate the published version of the schema using xsi:schemaLocation attribute for J2EE namespace with the following location: http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd The taglib tag is the document root. The definition of taglib is provided by the taglibType. Provides a hint as to the content of the body of this tag. Primarily intended for use by page composition tools. There are currently four values specified: tagdependent The body of the tag is interpreted by the tag implementation itself, and is most likely in a different "langage", e.g embedded SQL statements. JSP The body of the tag contains nested JSP syntax. empty The body must be empty scriptless The body accepts only template text, EL Expressions, and JSP action elements. No scripting elements are allowed. Describes the details of a single parameter that may be passed from a tag handler to a fragment, when the fragment is invoked. This allows the page author to know what variables to expect from the tag when passing in a fragment. A fragment-input element can have the following subelements: description Describes the purpose of this fragment-input name The name of the parameter to the fragment (required) type The type of parameter being passed (defaults to java.lang.String) The function element is used to provide information on each function in the tag library that is to be exposed to the EL. The function element may have several subelements defining: description Optional tag-specific information display-name A short name that is intended to be displayed by tools icon Optional icon element that can be used by tools name A unique name for this function function-class Provides the name of the Java class that implements the function function-signature Provides the signature, as in the Java Language Specification, of the Java method that is to be used to implement the function. example Optional informal description of an example of a use of this function A unique name for this function. Provides the fully-qualified class name of the Java class containing the static method that implements the function. Provides the signature, as in the Java Language Specification, of the static Java method that is to be used to implement the function. Example: java.lang.String nickName( java.lang.String, int ) The example element contains an informal description of an example of the use of this function. Defines an event listener object to be instantiated and registered automatically. The listener-class element declares a class in the application that must be registered as a web application listener bean. See the Servlet 2.3 specification for details. Defines an action in this tag library that is implemented as a .tag file. The tag-file element has two required subelements: name The unique action name path Where to find the .tag file implementing this action, relative to the location of the TLD file. The tag defines a unique tag in this tag library. It has one attribute, id. The tag element may have several subelements defining: description Optional tag-specific information display-name A short name that is intended to be displayed by tools icon Optional icon element that can be used by tools name The unique action name tag-class The tag handler class implementing javax.servlet.jsp.tagext.JspTag tei-class An optional subclass of javax.servlet.jsp.tagext.TagExtraInfo body-content The body content type variable Optional scripting variable information attribute All attributes of this action that are evaluated prior to invocation. fragment-attribute All attributes of this action that implement javax.servlet.jsp.tagext.JspFragment and can be evaluated zero or more times by the tag handler. dynamic-attributes Whether this tag supports additional attributes with dynamic names. If true, the tag-class must implement the javax.servlet.jsp.tagext.DynamicAttributes interface. Defaults to false. example Optional informal description of an example of a use of this tag Defines the subclass of javax.serlvet.jsp.tagext.JspTag that implements the request time semantics for this tag. (required) Defines the subclass of javax.servlet.jsp.tagext.TagExtraInfo for this tag. (optional) If this is not given, the class is not consulted at translation time. The default (if not defined) is JSP The example element contains an informal description of an example of the use of a tag. The taglib tag is the document root, it defines: description a simple string describing the "use" of this taglib, should be user discernable display-name the display-name element contains a short name that is intended to be displayed by tools icon optional icon that can be used by tools tlib-version the version of the tag library implementation short-name a simple default short name that could be used by a JSP authoring tool to create names with a mnemonic value; for example, the it may be used as the prefered prefix value in taglib directives uri a uri uniquely identifying this taglib validator optional TagLibraryValidator information listener optional event listener specification tag one or more tags in the tag library tag-file one or more tag files in the tag library function zero or more EL functions defined in this tag library Describes this version (number) of the taglibrary. It is described as a dewey decimal. Defines a simple default name that could be used by a JSP authoring tool to create names with a mnemonicvalue; for example, it may be used as the preferred prefix value in taglib directives. Do not use white space, and do not start with digits or underscore. Defines a public URI that uniquely identifies this version of the taglibrary. Leave it empty if it does not apply. Describes the JSP version (number) this taglibrary requires in order to function (dewey decimal) The default is 2.0 The attribute element defines an attribute for the nesting tag. The attributre element may have several subelements defining: description a description of the attribute name the name of the attribute required whether the attribute is required or optional rtexprvalue whether the attribute is a runtime attribute type the type of the attributes Defines if the nesting attribute is required or optional. If not present then the default is "false", i.e the attribute is optional. Defines if the nesting attribute can have scriptlet expressions as a value, i.e the value of the attribute may be dynamically calculated at request time, as opposed to a static value determined at translation time. If not present then the default is "false", i.e the attribute has a static value Defines the Java type of the attributes value. For static values (those determined at translation time) the type is always java.lang.String. Defines the canonical name of a tag or attribute being defined. The name must conform to the lexical rules for an NMTOKEN. Defines the details of an attribute of type javax.servlet.jsp.tagext.JspFragment. Attributes defined of this type can be evaluated zero or more times by a tag handler. A fragment-attribute element can have the following subelements: description Describes the purpose of this fragment-attribute. name The name of the fragment attribute. required True if this fragment is required, or false if optional. Defaults to false. fragment-input The types of inputs that may be passed to this fragment by the tag handler. Defines if the nesting fragment attribute is required or optional. If not present then the default is "false", i.e the fragment attribute is optional. A validator that can be used to validate the conformance of a JSP page to using this tag library is defined by a validatorType. Defines the TagLibraryValidator class that can be used to validate the conformance of a JSP page to using this tag library. The init-param element contains a name/value pair as an initialization param. This type defines scope of the scripting variable. See TagExtraInfo for details. The allowed values are, "NESTED", "AT_BEGIN" and "AT_END". The variableType provides information on the scripting variables defined by using this tag. It is a (translation time) error for a tag that has one or more variable subelements to have a TagExtraInfo class that returns a non-null object. The subelements of variableType are of the form: description Optional description of this variable name-given The variable name as a constant name-from-attribute The name of an attribute whose (translation time) value will give the name of the variable. One of name-given or name-from-attribute is required. variable-class Name of the class of the variable. java.lang.String is default. declare Whether the variable is declared or not. True is the default. scope The scope of the scripting varaible defined. NESTED is default. The name for the scripting variable. The name of an attribute whose (translation-time) value will give the name of the variable. The optional name of the class for the scripting variable. The default is java.lang.String. Whether the scripting variable is to be defined or not. See TagExtraInfo for details. This element is optional and "true" is the default. The element is optional and "NESTED" is the default. 1.2 +52 -7 jakarta-servletapi-5/src/share/javax/servlet/jsp/el/ExpressionEvaluator.java Index: ExpressionEvaluator.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/el/ExpressionEvaluator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ExpressionEvaluator.java 16 Jul 2002 16:38:41 -0000 1.1 +++ ExpressionEvaluator.java 30 Jul 2002 22:59:46 -0000 1.2 @@ -58,6 +58,7 @@ import javax.servlet.*; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; +import java.util.Map; /** *

The interface for an expression-language validator and evaluator. @@ -73,6 +74,11 @@ * they depend on transient state. Implementations should not, however, * assume that only one object of each ExpressionEvaluator type will be * instantiated; global caching should therefore be static.

+ * + *

There are two variants of the evaluation method. The most general one + * uses a VariableResolver instance to resolve names into objects. Most invocations + * will likely use the variant that uses a jspContext object and uses the default + * resolution rules.

*/ public interface ExpressionEvaluator { @@ -85,26 +91,65 @@ */ public String validate( String expression ); - /** - * Evaluates the expression at request time. + + /** + * Evaluates the expression at request time. This variant uses a JspContext object + * that (implicitly) uses the default VariableResolver defined in the JSP 2.0 specification. + * + * if the jspContext parameter is not a PageContext, the only implicit object available + * is pageScope. + * + * If the jspContext parameter is a PageContext, all the implicit objects described in + * the specification are available. * * @param expression The expression to be evaluated * @param expectedType The expected type of the result of the evaluation * @param jspContext The context of the current evaluation, providing * the source of data for implicit objects. - * @param elFunctions A Map with keys containing function names of - * the form "namespace:function" and values as instances of + * @param prefixMap A Map with keys containing prefixes and values being + * the URI corresponding to that prefix in the taglib machinery. + * @param functionMap A Map with keys containing function names of + * the form "namespaceURI:function" and values as instances of * java.lang.reflect.Method objects indicating the method to * be invoked. Can be null, in which case functions are not * supported for this invocation. - * @param defaultPrefix The default prefix to use when a function is + * @param defaultURI The default URI to use when a function is * encountered with no namespace. * @exception JspException Thrown if the expression evaluation failed. */ public Object evaluate( String expression, Class expectedType, JspContext jspContext, - java.util.Map elFunctions, - String defaultPrefix ) + Map prefixMap, + Map functionMap, + String defaultURI ) + throws JspException; + + + /** + * Evaluates the expression at request time. This is the most general version that + * uses a VariableResolver object. + * + * @param expression The expression to be evaluated + * @param expectedType The expected type of the result of the evaluation + * @param resolver The variableResolver object to use, providing + * the source of data for implicit objects. + * @param prefixMap A Map with keys containing prefixes and values being + * the URI corresponding to that prefix in the taglib machinery. + * @param functionMap A Map with keys containing function names of + * the form "namespaceURI:function" and values as instances of + * java.lang.reflect.Method objects indicating the method to + * be invoked. Can be null, in which case functions are not + * supported for this invocation. + * @param defaultURI default URI to use when a function is + * encountered with no namespace. + * @exception JspException Thrown if the expression evaluation failed. + */ + public Object evaluate( String expression, + Class expectedType, + VariableResolver resolver, + Map prefixMap, + Map functionMap, + String defaultURI ) throws JspException; } 1.2 +6 -2 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/DynamicAttributes.java Index: DynamicAttributes.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/DynamicAttributes.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- DynamicAttributes.java 16 Jul 2002 16:38:41 -0000 1.1 +++ DynamicAttributes.java 30 Jul 2002 22:59:46 -0000 1.2 @@ -72,12 +72,16 @@ * Called when a tag declared to accept dynamic attributes is passed * an attribute that is not declared in the Tag Library Descriptor. * - * @param uri the namespace of the attribute, nor null if in the default + * @param uri the namespace of the attribute, or null if in the default * namespace. * @param localName the name of the attribute being set. * @param value the value of the attribute * @throws AttributeNotSupportedException if the tag handler wishes to - * signal that it does not accept the given attribute. + * signal that it does not accept the given attribute. The + * container must catch this exception and rethrow a JspException + * to the calling page before calling doStartTag() or doTag(). + * If a message is provided in the AttributeNotSupportedException, + * the corresponding JspException must contain the same message. */ public void setDynamicAttribute( String uri, String localName, Object value ) 1.2 +14 -13 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/SimpleTag.java Index: SimpleTag.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/SimpleTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SimpleTag.java 16 Jul 2002 16:38:41 -0000 1.1 +++ SimpleTag.java 30 Jul 2002 22:59:46 -0000 1.2 @@ -67,15 +67,17 @@ * have the equivalent power of IterationTag, but with a much * simpler lifecycle and interface. *

- * To support body content, the setJspBody() and - * getJspBody() methods are provided. The container invokes - * the setJspBody() method with a JspFragment - * object encapsulating the body of the tag. The tag handler implementation - * can call getJspBody().invoke() to evaluate the body as + * To support body content, the setJspBody() + * method is provided. The container invokes the setJspBody() + * method with a JspFragment object encapsulating the body of + * the tag. The tag handler implementation can call + * invoke() on that fragment to evaluate the body as * many times as it needs. + * + * @see SimpleTagSupport */ -public interface SimpleTag { +public interface SimpleTag extends JspTag { /** * Skip the rest of the page. @@ -90,12 +92,11 @@ public final static int EVAL_PAGE = 6; /** - * Used for an action declared to have an empty body. The single - * doTag() method replaces the doStartTag() and - * doEndTag() methods inherited from the Tag - * interface. + * Called by the container to invoke this tag. + * The implementation of this method is provided by the tag library + * developer, and handles all tag processing, body iteration, etc. * - * @return SKIP_PAGE to abort the processing, or EVAL_PAGE * to continue. + * @return SKIP_PAGE to abort the processing, or EVAL_PAGE to continue. */ public int doTag() throws javax.servlet.jsp.JspException; @@ -103,12 +104,12 @@ /** * Sets the parent of this tag, for collaboration purposes. */ - public void setParent( Object parent ); + public void setParent( JspTag parent ); /** * Returns the parent of this tag, for collaboration purposes. */ - public Object getParent(); + public JspTag getParent(); /** * Stores the provided page context in the protected 1.2 +68 -4 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/SimpleTagSupport.java Index: SimpleTagSupport.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/SimpleTagSupport.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SimpleTagSupport.java 16 Jul 2002 16:38:41 -0000 1.1 +++ SimpleTagSupport.java 30 Jul 2002 22:59:46 -0000 1.2 @@ -69,7 +69,7 @@ implements SimpleTag { /** Reference to the enclosing tag */ - private Object parentTag; + private JspTag parentTag; /** The JSP context for the upcoming tag invocation */ private JspContext jspContext; @@ -93,14 +93,14 @@ /** * Sets the parent of this tag, for collaboration purposes. */ - public void setParent( Object parent ) { + public void setParent( JspTag parent ) { this.parentTag = parent; } /** * Returns the parent of this tag, for collaboration purposes. */ - public Object getParent() { + public JspTag getParent() { return this.parentTag; } @@ -138,5 +138,69 @@ return this.jspBody; } - + /** + * Find the instance of a given class type that is closest to a given + * instance. + * This method uses the getParent method from the Tag and/or SimpleTag + * interfaces. This method is used for coordination among + * cooperating tags. + * + *

+ * The current version of the specification only provides one formal + * way of indicating the observable type of a tag handler: its + * tag handler implementation class, described in the tag-class + * subelement of the tag element. This is extended in an + * informal manner by allowing the tag library author to + * indicate in the description subelement an observable type. + * The type should be a subtype of the tag handler implementation + * class or void. + * This addititional constraint can be exploited by a + * specialized container that knows about that specific tag library, + * as in the case of the JSP standard tag library. + * + *

+ * When a tag library author provides information on the + * observable type of a tag handler, client programmatic code + * should adhere to that constraint. Specifically, the Class + * passed to findAncestorWithClass should be a subtype of the + * observable type. + * + * + * @param from The instance from where to start looking. + * @param klass The subclass of JspTag or interface to be matched + * @return the nearest ancestor that implements the interface + * or is an instance of the class specified + */ + public static final JspTag findAncestorWithClass( + JspTag from, Class klass) + { + boolean isInterface = false; + + if (from == null || + klass == null || + (!JspTag.class.isAssignableFrom(klass) && + !(isInterface = klass.isInterface()))) { + return null; + } + + for (;;) { + JspTag tag = null; + if( from instanceof SimpleTag ) { + tag = ((SimpleTag)from).getParent(); + } + else if( from instanceof Tag ) { + tag = ((Tag)from).getParent(); + } + + if (tag == null) { + return null; + } + + if ((isInterface && klass.isInstance(tag)) || + klass.isAssignableFrom(tag.getClass())) + return tag; + else + from = tag; + } + } } 1.2 +1 -1 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/Tag.java Index: Tag.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/Tag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Tag.java 16 Jul 2002 16:38:41 -0000 1.1 +++ Tag.java 30 Jul 2002 22:59:46 -0000 1.2 @@ -127,7 +127,7 @@ * "passed through" to the current out. */ -public interface Tag { +public interface Tag extends JspTag { /** * Skip body evaluation. 1.2 +5 -5 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagAdapter.java Index: TagAdapter.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagAdapter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TagAdapter.java 16 Jul 2002 16:38:41 -0000 1.1 +++ TagAdapter.java 30 Jul 2002 22:59:46 -0000 1.2 @@ -59,7 +59,7 @@ /** - * Wraps any Object and exposes it using a Tag interface. This is used + * Wraps any JspTag and exposes it using a Tag interface. This is used * to allow collaboration between classic Tag handlers and SimpleTag * handlers. *

@@ -78,13 +78,13 @@ private Tag parentTag; /** The tag that's being adapted */ - private Object adaptee; + private JspTag adaptee; /** * Creates a new TagAdapter that wraps the given tag and * returns the given parent tag when getParent() is called. */ - public TagAdapter( Object adaptee, Tag parentTag ) { + public TagAdapter( JspTag adaptee, Tag parentTag ) { this.adaptee = adaptee; this.parentTag = parentTag; } @@ -125,7 +125,7 @@ * This should be an instance of SimpleTag in JSP 2.0, but room * is left for other kinds of tags in future spec versions. */ - public void setAdaptee( Object adaptee ) { + public void setAdaptee( JspTag adaptee ) { this.adaptee = adaptee; } @@ -134,7 +134,7 @@ * This should be an instance of SimpleTag in JSP 2.0, but room * is left for other kinds of tags in future spec versions. */ - public Object getAdaptee() { + public JspTag getAdaptee() { return this.adaptee; } 1.2 +3 -2 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagData.java Index: TagData.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagData.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TagData.java 16 Jul 2002 16:38:41 -0000 1.1 +++ TagData.java 30 Jul 2002 22:59:46 -0000 1.2 @@ -61,8 +61,9 @@ * The (translation-time only) attribute/value information for a tag instance. * *

- * TagData is only used as an argument to the isValid and getVariableInfo - * methods of TagExtraInfo, which are invoked at translation time. + * TagData is only used as an argument to the isValid, validate, and + * getVariableInfo methods of TagExtraInfo, which are invoked at + * translation time. */ public class TagData implements Cloneable { 1.2 +31 -1 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagExtraInfo.java Index: TagExtraInfo.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagExtraInfo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TagExtraInfo.java 16 Jul 2002 16:38:41 -0000 1.1 +++ TagExtraInfo.java 30 Jul 2002 22:59:47 -0000 1.2 @@ -79,7 +79,7 @@ * is through a setTagInfo() call, and thus, TagExtraInfo.setTagInfo() is * to be called by the JSP translator, with a TagInfo object that * corresponds to the tag being translated. The call should happen before - * any invocation on isValid() and before any invocation on + * any invocation on validate() and before any invocation on * getVariableInfo(). */ @@ -100,13 +100,43 @@ /** * Translation-time validation of the attributes. * Request-time attributes are indicated as such in the TagData parameter. + * Note that the preferred way to do validation is with the validate() + * method, since it can return more detailed information. * * @param data The TagData instance. * @return Whether this tag instance is valid. + * @see TagExtraInfo#validate */ public boolean isValid(TagData data) { return true; + } + + /** + * Translation-time validation of the attributes. + * Request-time attributes are indicated as such in the TagData parameter. + * Because of the higher quality validation messages possible, + * this is the preferred way to do validation (although isValid() + * still works). + * + *

JSP 2.0 and higher containers call validate() instead of isValid(). + * The default implementation of this method is to call isValid(). If + * isValid() returns false, a generic ValidationMessage[] is returned + * indicating isValid() returned false.

+ * + * @param data The TagData instance. + * @return A null object, or zero length array if no errors, an + * array of ValidationMessages otherwise. + */ + public ValidationMessage[] validate( TagData data ) { + ValidationMessage[] result = null; + + if( !isValid( data ) ) { + result = new ValidationMessage[] { + new ValidationMessage( data.getId(), "isValid() == false" ) }; + } + + return result; } /** 1.2 +24 -11 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagInfo.java Index: TagInfo.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagInfo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TagInfo.java 16 Jul 2002 16:38:41 -0000 1.1 +++ TagInfo.java 30 Jul 2002 22:59:47 -0000 1.2 @@ -91,7 +91,7 @@ public static final String BODY_CONTENT_SCRIPTLESS = "SCRIPTLESS"; /** - * Constructor for TagInfo from data in the JSP 1.1 format for TLD. + * Constructor for TagInfo from data in the JSP 2.0 format for TLD. * This class is to be instantiated only from the TagLibrary code * under request from some JSP code that is parsing a * TLD (Tag Library Descriptor). @@ -287,16 +287,29 @@ * @param data The translation-time TagData instance. * @return Whether the data is valid. */ + public boolean isValid(TagData data) { + TagExtraInfo tei = getTagExtraInfo(); + if (tei == null) { + return true; + } + return tei.isValid(data); + } - - public boolean isValid(TagData data) { - TagExtraInfo tei = getTagExtraInfo(); - if (tei == null) { - return true; - } - return tei.isValid(data); - } - + /** + * Translation-time validation of the attributes. + * This is a convenience method on the associated TagExtraInfo class. + * + * @param data The translation-time TagData instance. + * @return A null object, or zero length array if no errors, an + * array of ValidationMessages otherwise. + */ + public ValidationMessage[] validate( TagData data ) { + TagExtraInfo tei = getTagExtraInfo(); + if( tei == null ) { + return null; + } + return tei.validate( data ); + } /** * Set the instance for extra tag information @@ -381,7 +394,7 @@ } - // ============== JSP 1.2 TLD Information ======== + // ============== JSP 2.0 TLD Information ======== /** 1.2 +67 -4 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagLibraryInfo.java Index: TagLibraryInfo.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagLibraryInfo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TagLibraryInfo.java 16 Jul 2002 16:38:41 -0000 1.1 +++ TagLibraryInfo.java 30 Jul 2002 22:59:47 -0000 1.2 @@ -56,6 +56,7 @@ package javax.servlet.jsp.tagext; import javax.servlet.jsp.tagext.TagInfo; +import javax.servlet.jsp.tagext.TagFileInfo; import java.net.URL; @@ -77,15 +78,33 @@ * Constructor. * * This will invoke the constructors for TagInfo, and TagAttributeInfo - * after parsing the TLD file. + * after parsing the TLD file. Sets tagdir to null. * * @param prefix the prefix actually used by the taglib directive * @param uri the URI actually used by the taglib directive */ - protected TagLibraryInfo(String prefix, String uri) { + this( prefix, uri, null ); + } + + /** + * JSP 2.0 Constructor. + * + * This will invoke the constructors for TagInfo, and TagAttributeInfo + * after parsing the TLD file. + * + * @param prefix the prefix actually used by the taglib directive + * @param uri the URI actually used by the taglib directive. Either + * uri or tagdir must be null. + * @param tagdir the directory of tag files, starting with /WEB-INF/tags/ + * if this directive is specifying the directory of an implicit + * tag library composed of tag files. Either uri or tagdir + * must be null. + */ + protected TagLibraryInfo(String prefix, String uri, String tagdir) { this.prefix = prefix; this.uri = uri; + this.tagdir = tagdir; } @@ -102,6 +121,16 @@ } /** + * The value of the tagdir attribute from the <%@ taglib directive for + * this tag library. + * + * @return the value of the tagdir attribute + */ + public String getTagdir() { + return tagdir; + } + + /** * The prefix assigned to this taglib from the <%taglib directive * * @return the prefix assigned to this taglib from the <%taglib directive @@ -165,15 +194,23 @@ * * @return the tags defined in this tag lib */ - public TagInfo[] getTags() { return tags; } + /** + * An array describing the tag files that are defined in this tag library. + * + * @return the tag files defined in this tag lib + */ + public TagFileInfo[] getTagFiles() { + return tagFiles; + } + /** * Get the TagInfo for a given tag name, looking through all the - * tags in this tag library. + * tags in this tag library. Returns null if no tag is found. * * @param shortname The short name (no prefix) of the tag * @return the TagInfo for that tag. @@ -196,6 +233,30 @@ } /** + * Get the TagFileInfo for a given tag name, looking through all the + * tag files in this tag library. Returns null if no tag file is found. + * + * @param shortname The short name (no prefix) of the tag + * @return the TagFileInfo for that tag file. + */ + + public TagFileInfo getTagFile(String shortname) { + TagFileInfo tagFiles[] = getTagFiles(); + + if (tagFiles == null || tagFiles.length == 0) { + System.err.println("No tags"); + return null; + } + + for (int i=0; i < tagFiles.length; i++) { + if (tagFiles[i].getName().equals(shortname)) { + return tagFiles[i]; + } + } + return null; + } + + /** * An array describing the functions that are defined in this tag library. * * @return the functions defined in this tag lib @@ -234,8 +295,10 @@ protected String prefix; protected String uri; + protected String tagdir; protected TagInfo[] tags; + protected TagFileInfo[] tagFiles; protected FunctionInfo[] functions; // Tag Library Data 1.2 +2 -2 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagLibraryValidator.java Index: TagLibraryValidator.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagLibraryValidator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TagLibraryValidator.java 16 Jul 2002 16:38:41 -0000 1.1 +++ TagLibraryValidator.java 30 Jul 2002 22:59:47 -0000 1.2 @@ -90,9 +90,9 @@ * synchronization they may require. * *

- * A JSP container may optionally support a jsp:id attribute to + * As of JSP 2.0, a JSP container must provide a jsp:id attribute to * provide higher quality validation errors. - * When supported, the container will track the JSP pages + * The container will track the JSP pages * as passed to the container, and will assign to each element * a unique "id", which is passed as the value of the jsp:id * attribute. Each XML element in the XML view available will 1.2 +1 -1 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagVariableInfo.java Index: TagVariableInfo.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagVariableInfo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TagVariableInfo.java 16 Jul 2002 16:38:41 -0000 1.1 +++ TagVariableInfo.java 30 Jul 2002 22:59:47 -0000 1.2 @@ -62,7 +62,7 @@ * * This object should be immutable. * - * This information is only available in JSP 1.2 format + * This information is only available in JSP 2.0 format */ public class TagVariableInfo { 1.2 +2 -2 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/ValidationMessage.java Index: ValidationMessage.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/ValidationMessage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ValidationMessage.java 16 Jul 2002 16:38:41 -0000 1.1 +++ ValidationMessage.java 30 Jul 2002 22:59:47 -0000 1.2 @@ -59,9 +59,9 @@ /** * A validation message from a TagLibraryValidator. *

- * A JSP container may (optionally) support a jsp:id attribute + * As of JSP 2.0, a JSP container must support a jsp:id attribute * to provide higher quality validation errors. - * When supported, the container will track the JSP pages + * The container will track the JSP pages * as passed to the container, and will assign to each element * a unique "id", which is passed as the value of the jsp:id * attribute. Each XML element in the XML view available will 1.2 +3 -3 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/VariableInfo.java Index: VariableInfo.java =================================================================== RCS file: /home/cvs/jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/VariableInfo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- VariableInfo.java 16 Jul 2002 16:38:41 -0000 1.1 +++ VariableInfo.java 30 Jul 2002 22:59:47 -0000 1.2 @@ -78,7 +78,7 @@ *

* If a Fully Qualified Class Name is provided, it should refer to a * class that should be in the CLASSPATH for the Web Application (see - * Servlet 2.3 specification - essentially it is WEB-INF/lib and + * Servlet 2.4 specification - essentially it is WEB-INF/lib and * WEB-INF/classes). Failure to be so will lead to a translation-time * error. * @@ -87,7 +87,7 @@ * the class name must be that of a public class in the context of the * import directives of the page where the custom action appears (will * check if there is a JLS verbiage to refer to). The class must also - * be in the CLASSPATH for the Web Application (see Servlet 2.3 + * be in the CLASSPATH for the Web Application (see Servlet 2.4 * specification - essentially it is WEB-INF/lib and * WEB-INF/classes). Failure to be so will lead to a translation-time * error. @@ -122,7 +122,7 @@ * * *

- * The JSP 1.2 specification defines the interpretation of 3 values: + * The JSP 2.0 specification defines the interpretation of 3 values: * *

    *
  • NESTED, if the scripting variable is available between 1.1 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/JspTag.java Index: JspTag.java =================================================================== /* * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . * */ package javax.servlet.jsp.tagext; /** * Serves as a base class for Tag and SimpleTag. * This is mostly for organizational and type-safety purposes. */ public interface JspTag { } 1.1 jakarta-servletapi-5/src/share/javax/servlet/jsp/tagext/TagFileInfo.java Index: TagFileInfo.java =================================================================== /* * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . * */ package javax.servlet.jsp.tagext; /** * Tag information for a tag file in a Tag Library; * This class is instantiated from the Tag Library Descriptor file (TLD) * and is available only at translation time. */ public class TagFileInfo { /** * Constructor for TagFileInfo from data in the JSP 2.0 format for TLD. * This class is to be instantiated only from the TagLibrary code * under request from some JSP code that is parsing a * TLD (Tag Library Descriptor). * * Note that, since TagLibibraryInfo reflects both TLD information * and taglib directive information, a TagFileInfo instance is * dependent on a taglib directive. This is probably a * design error, which may be fixed in the future. * * @param name The unique action name of this tag * @param path Where to find the .tag file implementing this * action, relative to the location of the TLD file. * @param tagInfo The detailed information about this tag, as parsed * from the directives in the tag file. */ public TagFileInfo( String name, String path, TagInfo tagInfo ) { this.name = name; this.path = path; this.tagInfo = tagInfo; } /** * The unique action name of this tag. * * @return The (short) name of the tag. */ public String getName() { return name; } /** * Where to find the .tag file implementing this action. * * @return The path of the tag file, relative to the TLD, or "." if * the tag file was defined in an implicit tag file. */ public String getPath() { return path; } /** * Returns information about this tag, parsed from the directives * in the tag file. */ public TagInfo getTagInfo() { return tagInfo; } // private fields for 2.0 info private String name; private String path; private TagInfo tagInfo; } -- To unsubscribe, e-mail: For additional commands, e-mail: