You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bl...@lgenc.co.kr on 2000/02/28 03:53:23 UTC

newbie questions... WEB.XML file analysis...

Hi all...

Could someone let me know the meaning of scripts?

The following is the part of /examples/WEB-INFO/web.xml file...

    <taglib>
        <taglib-uri>
        http://java.apache.org/tomcat/examples-taglib
        </taglib-uri>
        <taglib-location>
           /WEB-INF/jsp/example-taglib.tld
        </taglib-location>
    </taglib>

I would like to know the meaning of  <taglib-uri> and <taglib-location>..

What is the purpose of those tag?

If /examples firecotry could be copied to 'PID' and 'example-taltaglib.tld'
were changed to 'PID.tld' ,
then should 'http://java.apache.org/tomcat/examples-taglib' be changed to
'http://java.apache.org/tomcat/PID' ?...

And I would like to know the <servlet-name> tag and <url-pattern> tag...

    <servlet-mapping>
        <servlet-name>
            snoop
        </servlet-name>
        <url-pattern>
            /snoop
        </url-pattern>
    </servlet-mapping>


Thanks in advance...




Re: newbie questions... WEB.XML file analysis...

Posted by "Craig R. McClanahan" <cm...@mytownnet.com>.
blueless@lgenc.co.kr wrote:

> Hi all...
>
> Could someone let me know the meaning of scripts?
>

The meaning of the <taglib> tag, and all the others in the web.xml file, is
described in the Servlet API Specification version 2.2, which is available at
JavaSoft's web site (to to <http://java.sun.com/products/servlet/2.2> and
download the spec in PDF format).

>
> The following is the part of /examples/WEB-INFO/web.xml file...
>
>     <taglib>
>         <taglib-uri>
>         http://java.apache.org/tomcat/examples-taglib
>         </taglib-uri>
>         <taglib-location>
>            /WEB-INF/jsp/example-taglib.tld
>         </taglib-location>
>     </taglib>
>
> I would like to know the meaning of  <taglib-uri> and <taglib-location>..
>

These two elements define the location of the tag library descriptor for the
JSP custom tags being used.  More information about custom tags can be found
in the JavaServerPages Specification version 1.1, at
<http://java.sun.com/products/jsp/download.html>.

>
> What is the purpose of those tag?
>
> If /examples firecotry could be copied to 'PID' and 'example-taltaglib.tld'
> were changed to 'PID.tld' ,
> then should 'http://java.apache.org/tomcat/examples-taglib' be changed to
> 'http://java.apache.org/tomcat/PID' ?...
>
> And I would like to know the <servlet-name> tag and <url-pattern> tag...
>
>     <servlet-mapping>
>         <servlet-name>
>             snoop
>         </servlet-name>
>         <url-pattern>
>             /snoop
>         </url-pattern>
>     </servlet-mapping>
>

These are discussed in the servlet spec.  What it says is that if you invoke
the request URI "/snoop" you will execute the servlet named "snoop", which is
defined elsewhere in the web.xml file to be class SnoopServlet.  With a
<servlet-mapping>, you can attach any servlet you like to a particular requst
URI, to an entire "directory", or to a particular filename extension.

>
> Thanks in advance...
>

Craig McClanahan