Dennis Sasinka wrote:

> I have been looking through the Servlet Specification v2.2 and I am not
> finding what I need.  Could someone direct me to documentation that outlines
> the syntax for specifying an alias for servlets running under Tomcat?

The particular part of the servlet spec you want to look at is Chapter
10:
"Mapping Requests to Servlets".  A brief example will suffice to
illustrate the
concept -- for more than that, you will want to read one of the many
articles or
books being published about the 2.2 specification.

In the example below, I'm assuming that your web application has been
installed on a context path named "/myapp".  How you do this is specific
to the
servlet container you are running -- consult the server docs for more
info.

Let's say you want the following URL:

    http://www.mycompany.com/myapp/myservlet

to execute your servlet, which is class
com.mycompany.myservlets.MyServlet.  You
would include the following settings in the web.xml file of your web
app:

    <servlet>
        <servlet-name>MyServlet</servlet-name>

<servlet-class>com.mycompany.myservlets.MyServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>MyServlet</servlet-name>
        <url-pattern>/myservlet</url-pattern>
    </servlet-mapping>

You can also map a servlet to a particular filename extension (this is
generally
how servlet containers make sure all JSP pages are processed by the JSP
page
compiler servlet, for example), or to entire "directories" in the URL
path.

>
> thanks much

Craig McClanahan

====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to