You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Ias <ia...@apache-korea.org> on 2003/09/27 05:16:45 UTC

About taglib-location value and other path values in web.xml

>From Servlet 2.4 and JSP 2.0, web.xml is under several schemas.
Firs see the following:


Index: TldConfig.java
===================================================================
RCS file:
/home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catali
na/startup/TldConfig.java,v
retrieving revision 1.29
diff -u -r1.29 TldConfig.java
--- TldConfig.java	25 Sep 2003 19:27:59 -0000	1.29
+++ TldConfig.java	26 Sep 2003 08:52:29 -0000
@@ -671,6 +671,11 @@
             String resourcePath = context.findTaglib(taglibs[i]);
             // FIXME - Servlet 2.4 DTD implies that the location MUST be
             // a context-relative path starting with '/'?
+            // FYI - <taglib-location> subelement of <taglib> element
+            // is typed as <j2ee:pathType>, which is now yet an another
j2ee:string.
+            // Therefore one cannot suppose <taglib-location> content
+            // should start with "/".
+            
             if (!resourcePath.startsWith("/")) {
                 resourcePath = "/WEB-INF/" + resourcePath;
             }

As I added, I think it would be good to have absolutePathType in
j2ee_1_4.xsd so that we can take advantage of its constraint.

<xsd:complexType name="absolutePathType">
  <xsd:annotation>
    <xsd:documentation>

  The elements that use this type designate an absolute path starting with a
"/".

    </xsd:documentation>
  </xsd:annotation>
  <xsd:simpleContent>
    <xsd:restriction base="j2ee:pathType">
      <xsd:pattern value="/.*"/>
    </xsd:restriction>
  </xsd:simpleContent>
</xsd:complextType>

Actually this declaration is very similar to that of war-pathType in
web-app_2_4.xsd except their base types, j2ee:pathType and j2ee:string. If
we can use this type, it is also possible to type taglib-location or some
PATH-derived element by it and drive users to follow the notation of the
absolute path. In addition, the absolutePathType can help about the issue at
http://marc.theaimsgroup.com/?l=tomcat-dev&m=106456019300386&w=2 . At the
same time, I suggest PATH-derived element with 

"(as a resource relative to the root of the web application)"

description should use absolutePathType for avoiding ambiguity.

Thanks,

Ias

=========================================================
Lee, Changshin (Korean name)
Ias (International name)
           Company Web Site: http://www.tmax.co.kr
           Personal Web Site: http://www.iasandcb.pe.kr
---------------------------------------------------------
Senior Researcher, Emerging Technology Evangelist
JCP member - http://jcp.org/en/participation/members/L
R&D Institute
Tmax Soft, Inc.
JCP member - http://jcp.org/en/participation/members/T
=========================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org