Thanks for the hint, Andrea. I've changed the mapping class in
main.jar/applicationContext.xml and added "/openlayers/**" like this:

  <bean id="filePublisherMapping"
    class="org.geoserver.ows.OWSHandlerMapping">
    <constructor-arg ref="catalog"/>
     <property name="alwaysUseFullPath" value="true"/>
     <property name="mappings">
       <props>
        <prop key="/styles/**">filePublisher</prop>
        <prop key="/www/**">filePublisher</prop>
        <prop key="/openlayers/**">filePublisher</prop>
       </props>
     </property>
  </bean>

Now, when requesting "/nurc/www/openlayers/theme/default/style.css" the
response is a 404 and the logs says:

05 Mar 17:01:31 TRACE [ows.OWSHandlerMapping] - No handler mapping found
for [/nurc/www/openlayers/theme/default/style.css]
05 Mar 17:01:31 DEBUG [ows.OWSHandlerMapping] - Matching patterns for
request [/www/openlayers/theme/default/style.css] are [/www/**]
05 Mar 17:01:31 DEBUG [ows.OWSHandlerMapping] - URI Template variables for
request [/www/openlayers/theme/default/style.css] are {}
05 Mar 17:01:31 DEBUG [ows.OWSHandlerMapping] - Mapping
[/nurc/www/openlayers/theme/default/style.css] to HandlerExecutionChain
with handler [org.geoserver.ows.FilePublisher@6fdd647a] and 1 interceptor
05 Mar 17:01:31 DEBUG [filter.GeoServerSecurityContextPersistenceFilter$1]
- SecurityContextHolder now cleared, as request processing completed

It looks like the the OWSHandlerMapping class strips the workspace name
(line 2) from the request but than maps the full name with workspace name
to the FilePublisher (line 4). I've also tested
"/nurc/openlayers/theme/default/style.css" with similar result. Furthermore
I've copied the www/openlayers directory to workspaces/nurc/openlayers and
workspaces/nurc/www/openlayers for test purposes but get back a 404 as well.

Am I missing something?

Regards, Torsten


On Tue, Mar 5, 2013 at 9:40 AM, Andrea Aime <andrea.a...@geo-solutions.it>wrote:

> On Mon, Mar 4, 2013 at 4:36 PM, thegis <the...@googlemail.com> wrote:
>
>> As we like to keep using virtual service behind a proxy, I was wondering
>> if the global contexts (or at least a subset) could additionally be
>> published below the virtual services contexts, e.g. throught the dispatcher
>> servlet or web.xml?
>>
>
> The resources you're citing are served directly from the classpath using
> the FilePublisher class, which is bound
> to them in the spring context.
> In order to have that work also for virtual workspaces I guess some sort I
> guess the url mappings
> in the spring context for the classpathPublisher should also use the
> GeoServer custom
> org.geoserver.ows.OWSHandlerMapping instead of Spring's own
> org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
>
> The change would likely have to happen in main module,
> applicationContext.xml, around line 150 to 170.
> However, I'm not sure if there are any side effects from doing that.
>
> Cheers
> Andrea
>
>
> --
> ==
> Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
> information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39  339 8844549
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> -------------------------------------------------------
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to