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 13:21:43 GMT
[Need more coffee]

Does that mean that http://myserver/context/resources is serving a dir 
listing of the contents from http://myserver/context ?
(instead of /context/resources)

-Tim

Samuel Le Berrigaud wrote:

> Of course it is a directory but tomcat lists / which contains the 
> resources directory (in fact to list / I would only check 
> http://myserver/context)
> 
> SaM
> 
> Tim Funk wrote:
> 
>> If http://myserver/context/resources is a directory, then that is the 
>> correct behavior on how things work.
>>
>> -Tim
>>
>> Samuel Le Berrigaud wrote:
>>
>>> Hi,
>>>
>>> I cannot change the code of my servlet since I use the Turbine 
>>> framework. So I tried your second solution which doesn't work 
>>> anymore. When I now want to access http://myserver/context/resources, 
>>> I have the "directory listing for /" page ...
>>>
>>> Maybe anyone have an idea of what's hapening, or maybe should I give 
>>> up my idea ?!
>>>
>>> Thanks,
>>>
>>> SaM
>>>
>>> Tim Funk wrote:
>>>
>>>> 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
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
> 
> 
> ---------------------------------------------------------------------
> 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