tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: Access static content ...
Date Fri, 07 Nov 2003 12:25:45 GMT
Or you might be able to get away with this to in web.xml ...
<servlet-mapping>
   <url>/resources</url>
   <servlet>default</servlet>
</servlet-mapping>
<servlet-mapping>
   <url>/resources/*</url>
   <servlet>default</servlet>
</servlet-mapping>

-Tim

Tim Funk wrote:

> No, but this *might* work. Place it in your servlet which maps to /* ...
> (assuming your extending javax.servlet.http.HttpServlet)
> 
> 
> doGet(HttpServletRequest req, HttpServletResponse resp) {
>   if (req.getRequestURI().indexOf("/resources")>-1) {
>     //Use the default servlet to serve the static content
>     getServletContext().getNamedDispatcher("default").forward(req, resp);
>     return;
>   }
> 
>   //Normal logic
> }
> 
> -Tim
> 
> Samuel Le Berrigaud wrote:
> 
>> Hi all,
>>
>> I want to map my servlet with /* url pattern except the /resources 
>> directory which contains static content that I want to acces directly. 
>> Is there any particular configuration that could allow me to do so, in 
>> my web.xml file or in the server.xml config file ?
>>
>> I want to do that on a Tomcat 4.1
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


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


Mime
View raw message