tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: Servlet mapping question -- way to include everythign EXCEPT a directory?
Date Thu, 01 Jul 2010 16:31:25 GMT
> From: laredotornado [mailto:laredotornado@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


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.


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


Mime
View raw message