You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jonathan Soons <js...@juilliard.edu> on 2002/09/19 23:07:26 UTC

default servlet?

The 2.3 API says :

A string containing only the '/' character denotes the default servlet.
The servlet path is the request URI minus the context. 

I cannot find any other mention of "default servlet"

I have many servlets. How do I make one of them the default for my application?

jonathan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: default servlet?

Posted by Jacob Kjome <ho...@visi.com>.
Hello Jonathan,

The container provides the default servlet for your webapp.  In fact,
the default servlet is what is responsible for returning static files
such as .xml, .html, and .png files (to name just a few).

You would have to set up a servlet mapping of something like "/*" in
order to have your own servlet be the default servlet.  I think that
is legal, but it isn't overly useful.  Let the container manage those
kinds of details and create a mapping to something like "/myservlet"
or map your servlet to a suffix such as "*.srv" (or whatever you
want).  That way, you don't impose on all the other static files and
JSP's and anything else that exists in a standard webapp.

Jake

Thursday, September 19, 2002, 4:07:26 PM, you wrote:

JS> The 2.3 API says :

JS> A string containing only the '/' character denotes the default servlet.
JS> The servlet path is the request URI minus the context. 

JS> I cannot find any other mention of "default servlet"

JS> I have many servlets. How do I make one of them the default for my application?

JS> jonathan

JS> --
JS> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
JS> For additional commands, e-mail: <ma...@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: default servlet?

Posted by Jeff Wishnie <je...@deluxebiz.com>.
Use the following servlet-mapping in your web.xml:

<servlet-mapping>
    <servlet-name>My Servlet</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

Any request that does not match all other mappings will go to 'My Servlet'

-Jeff

----- Original Message ----- 
From: "Jonathan Soons" <js...@juilliard.edu>
To: <to...@jakarta.apache.org>
Sent: Thursday, September 19, 2002 2:07 PM
Subject: default servlet?


The 2.3 API says :

A string containing only the '/' character denotes the default servlet.
The servlet path is the request URI minus the context. 

I cannot find any other mention of "default servlet"

I have many servlets. How do I make one of them the default for my application?

jonathan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>