Caldarale, Charles R wrote:
From: laredotornado [mailto:laredotorn...@gmail.com]
Subject: RE: Servlet mapping question -- way to include everythign
EXCEPT a directory?

I like your idea about specifying the DefaultServlet, but what do you mean by the "DefaultServlet" ?

Tomcat's built-in servlet that handles all static content.  It's defined in the 
global conf/web.xml, and thus included in all deployed webapps:

<servlet>
  <servlet-name>default</servlet-name>
  <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
...snip...
</servlet>

It has this mapping:

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

so it gets to process anything that doesn't match any other mapping.  Just add 
this to your webapp's WEB-INF/web.xml:

<servlet-mapping>
  <servlet-name>default</servlet-name>
  <url-pattern>/play/sports/includes/*</url-pattern>
<servlet-mapping>

 - Chuck


If it isn't yet the case, this might be worth a short Wiki article, including the short explanation above. While it is true that this can be derived from the page at
http://tomcat.apache.org/tomcat-6.0-doc/default-servlet.html
I still believe it is not so evident for a beginner.
That page gives a complicated example to do with listings, but the OP's question is in fact a fairly basic and recurrent one.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to