Repository navigation
Fix GWC virtual service URLs and clean up handler mapping migration - #767
Merged
Merged
Conversation
groldan
force-pushed
the
fix/gwc_url_handling
branch
from
March 3, 2026 02:30
553e3ae to
3d446a0
Compare
* Fix virtual service GWC demo/REST URLs returning 404
- Add CloudGwcUrlHandlerMapping to update Spring 6's cached
PathPattern request path for virtual service handler matching
- Fix SetRequestPathInfoFilter to strip workspace prefix from
requestURI so GeoWebCacheDispatcher.normalizeURL() works
* Add missing gs-wms1_1 dependency to the gwc service after the WMS split
* Remove SeedControllerOverride, unnecessary after gwc migration to Spring 7 (ref: GeoWebCache/geowebcache#1467)
* Remove unnecessary requestMappingHandlerMapping bean
groldan
force-pushed
the
fix/gwc_url_handling
branch
from
March 3, 2026 02:37
3d446a0 to
79d4252
Compare
mohamed-aboshosha-up42
added a commit
to mohamed-aboshosha-up42/geoserver-cloud
that referenced
this pull request
Mar 9, 2026
Add GwcRequestPathInfoFilter and CloudGwcUrlHandlerMapping for improved URL handling - Introduced GwcRequestPathInfoFilter to adapt HttpServletRequest for proper path info handling in GWC. - Created CloudGwcUrlHandlerMapping to extend GwcUrlHandlerMapping, addressing issues with virtual service URL handling in Spring 6. - Updated GeoWebCacheApplicationConfiguration and RESTConfigConfiguration to utilize the new classes. - Added unit tests for both GwcRequestPathInfoFilter and CloudGwcUrlHandlerMapping to ensure correct functionality.
mohamed-aboshosha-up42
added a commit
to mohamed-aboshosha-up42/geoserver-cloud
that referenced
this pull request
Mar 9, 2026
Backport the GWC virtual service URL fix from geoserver#767 (main branch) to release/2.28.x, adapted for Spring 5 / javax.servlet. GWC virtual service URLs (e.g. /{workspace}/gwc/service/wmts, /{workspace}/gwc/demo/...) were not properly handled in GeoServer Cloud. The URL handler mapping and request path adaptation did not account for the workspace prefix at the HTTP dispatch level. New classes: - GwcRequestPathInfoFilter: servlet filter that adapts HttpServletRequest for GWC path info handling. For /gwc/service/** paths, the workspace prefix is preserved in the request URI so LocalWorkspaceCallback can detect the workspace. For non-service paths (/gwc/demo, /gwc/rest), the workspace prefix is stripped so GeoWebCacheDispatcher.normalizeURL() works correctly. - CloudGwcUrlHandlerMapping: extends GwcUrlHandlerMapping to fix virtual service URL matching with Spring's PathPattern-based request matching. Updates the cached parsed request path before delegation so workspace-prefixed URLs resolve to the correct controller. Changes to existing classes: - GeoServerTileLayerConfiguration: override getLayers() and getLayer() to filter by LocalWorkspace/LocalPublished thread-local context. This is the common TileLayerConfiguration decorator that wraps all backends, making it the correct abstraction level for virtual service filtering (analogous to upstream CatalogConfiguration.getTileLayerById()). - PgconfigTileLayerCatalog: pass catalog to GeoServerTileLayer constructor so getContextualName() can resolve workspace prefixes without NPE. The backend itself returns all layers unfiltered. - GeoWebCacheCoreConfiguration: replaced inline SetRequestPathInfoFilter with the new GwcRequestPathInfoFilter bean. - GeoWebCacheApplicationConfiguration: calls GwcRequestPathInfoFilter.adaptRequest() before the existing filter. - GeoWebCacheUIAutoConfiguration: added gwcDemoUrlHandlerMapping and gwcRestWebUrlHandlerMapping beans using CloudGwcUrlHandlerMapping. - RESTConfigConfiguration: use CloudGwcUrlHandlerMapping for the WMTS REST URL handler mapping. Includes unit tests for GwcRequestPathInfoFilter and CloudGwcUrlHandlerMapping. Refs: geoserver#767, geoserver#766
groldan
pushed a commit
to mohamed-aboshosha-up42/geoserver-cloud
that referenced
this pull request
Mar 17, 2026
Backport the GWC virtual service URL fix from geoserver#767 (main branch) to release/2.28.x, adapted for Spring 5 / javax.servlet. GWC virtual service URLs (e.g. /{workspace}/gwc/service/wmts, /{workspace}/gwc/demo/...) were not properly handled in GeoServer Cloud. The URL handler mapping and request path adaptation did not account for the workspace prefix at the HTTP dispatch level. New classes: - GwcRequestPathInfoFilter: servlet filter that adapts HttpServletRequest for GWC path info handling. For /gwc/service/** paths, the workspace prefix is preserved in the request URI so LocalWorkspaceCallback can detect the workspace. For non-service paths (/gwc/demo, /gwc/rest), the workspace prefix is stripped so GeoWebCacheDispatcher.normalizeURL() works correctly. - CloudGwcUrlHandlerMapping: extends GwcUrlHandlerMapping to fix virtual service URL matching with Spring's PathPattern-based request matching. Updates the cached parsed request path before delegation so workspace-prefixed URLs resolve to the correct controller. Changes to existing classes: - GeoServerTileLayerConfiguration: override getLayers() and getLayer() to filter by LocalWorkspace/LocalPublished thread-local context. This is the common TileLayerConfiguration decorator that wraps all backends, making it the correct abstraction level for virtual service filtering (analogous to upstream CatalogConfiguration.getTileLayerById()). - PgconfigTileLayerCatalog: pass catalog to GeoServerTileLayer constructor so getContextualName() can resolve workspace prefixes without NPE. The backend itself returns all layers unfiltered. - GeoWebCacheCoreConfiguration: replaced inline SetRequestPathInfoFilter with the new GwcRequestPathInfoFilter bean. - GeoWebCacheApplicationConfiguration: calls GwcRequestPathInfoFilter.adaptRequest() before the existing filter. - GeoWebCacheUIAutoConfiguration: added gwcDemoUrlHandlerMapping and gwcRestWebUrlHandlerMapping beans using CloudGwcUrlHandlerMapping. - RESTConfigConfiguration: use CloudGwcUrlHandlerMapping for the WMTS REST URL handler mapping. Includes unit tests for GwcRequestPathInfoFilter and CloudGwcUrlHandlerMapping. Refs: geoserver#767, geoserver#766
groldan
pushed a commit
to mohamed-aboshosha-up42/geoserver-cloud
that referenced
this pull request
Mar 17, 2026
Backport the GWC virtual service URL fix from geoserver#767 (main branch) to release/2.28.x, adapted for Spring 5 / javax.servlet. GWC virtual service URLs (e.g. /{workspace}/gwc/service/wmts, /{workspace}/gwc/demo/...) were not properly handled in GeoServer Cloud. The URL handler mapping and request path adaptation did not account for the workspace prefix at the HTTP dispatch level. New classes: - GwcRequestPathInfoFilter: servlet filter that adapts HttpServletRequest for GWC path info handling. For /gwc/service/** paths, the workspace prefix is preserved in the request URI so LocalWorkspaceCallback can detect the workspace. For non-service paths (/gwc/demo, /gwc/rest), the workspace prefix is stripped so GeoWebCacheDispatcher.normalizeURL() works correctly. - CloudGwcUrlHandlerMapping: extends GwcUrlHandlerMapping to fix virtual service URL matching with Spring's PathPattern-based request matching. Updates the cached parsed request path before delegation so workspace-prefixed URLs resolve to the correct controller. Changes to existing classes: - GeoServerTileLayerConfiguration: override getLayers() and getLayer() to filter by LocalWorkspace/LocalPublished thread-local context. This is the common TileLayerConfiguration decorator that wraps all backends, making it the correct abstraction level for virtual service filtering (analogous to upstream CatalogConfiguration.getTileLayerById()). - PgconfigTileLayerCatalog: pass catalog to GeoServerTileLayer constructor so getContextualName() can resolve workspace prefixes without NPE. The backend itself returns all layers unfiltered. - GeoWebCacheCoreConfiguration: replaced inline SetRequestPathInfoFilter with the new GwcRequestPathInfoFilter bean. - GeoWebCacheApplicationConfiguration: calls GwcRequestPathInfoFilter.adaptRequest() before the existing filter. - GeoWebCacheUIAutoConfiguration: added gwcDemoUrlHandlerMapping and gwcRestWebUrlHandlerMapping beans using CloudGwcUrlHandlerMapping. - RESTConfigConfiguration: use CloudGwcUrlHandlerMapping for the WMTS REST URL handler mapping. Includes unit tests for GwcRequestPathInfoFilter and CloudGwcUrlHandlerMapping. Refs: geoserver#767, geoserver#766
groldan
pushed a commit
to mohamed-aboshosha-up42/geoserver-cloud
that referenced
this pull request
Mar 17, 2026
Backport the GWC virtual service URL fix from geoserver#767 (main branch) to release/2.28.x, adapted for Spring 5 / javax.servlet. GWC virtual service URLs (e.g. /{workspace}/gwc/service/wmts, /{workspace}/gwc/demo/...) were not properly handled in GeoServer Cloud. The URL handler mapping and request path adaptation did not account for the workspace prefix at the HTTP dispatch level. New classes: - GwcRequestPathInfoFilter: servlet filter that adapts HttpServletRequest for GWC path info handling. For /gwc/service/** paths, the workspace prefix is preserved in the request URI so LocalWorkspaceCallback can detect the workspace. For non-service paths (/gwc/demo, /gwc/rest), the workspace prefix is stripped so GeoWebCacheDispatcher.normalizeURL() works correctly. - CloudGwcUrlHandlerMapping: extends GwcUrlHandlerMapping to fix virtual service URL matching with Spring's PathPattern-based request matching. Updates the cached parsed request path before delegation so workspace-prefixed URLs resolve to the correct controller. Changes to existing classes: - GeoServerTileLayerConfiguration: override getLayers() and getLayer() to filter by LocalWorkspace/LocalPublished thread-local context. This is the common TileLayerConfiguration decorator that wraps all backends, making it the correct abstraction level for virtual service filtering (analogous to upstream CatalogConfiguration.getTileLayerById()). - PgconfigTileLayerCatalog: pass catalog to GeoServerTileLayer constructor so getContextualName() can resolve workspace prefixes without NPE. The backend itself returns all layers unfiltered. - GeoWebCacheCoreConfiguration: replaced inline SetRequestPathInfoFilter with the new GwcRequestPathInfoFilter bean. - GeoWebCacheApplicationConfiguration: calls GwcRequestPathInfoFilter.adaptRequest() before the existing filter. - GeoWebCacheUIAutoConfiguration: added gwcDemoUrlHandlerMapping and gwcRestWebUrlHandlerMapping beans using CloudGwcUrlHandlerMapping. - RESTConfigConfiguration: use CloudGwcUrlHandlerMapping for the WMTS REST URL handler mapping. Includes unit tests for GwcRequestPathInfoFilter and CloudGwcUrlHandlerMapping. Refs: geoserver#767, geoserver#766
mohamed-aboshosha-up42
added a commit
to mohamed-aboshosha-up42/geoserver-cloud
that referenced
this pull request
Mar 19, 2026
Backport the GWC virtual service URL fix from geoserver#767 (main branch) to release/2.28.x, adapted for Spring 5 / javax.servlet. GWC virtual service URLs (e.g. /{workspace}/gwc/service/wmts, /{workspace}/gwc/demo/...) were not properly handled in GeoServer Cloud. The URL handler mapping and request path adaptation did not account for the workspace prefix at the HTTP dispatch level. New classes: - GwcRequestPathInfoFilter: servlet filter that adapts HttpServletRequest for GWC path info handling. For /gwc/service/** paths, the workspace prefix is preserved in the request URI so LocalWorkspaceCallback can detect the workspace. For non-service paths (/gwc/demo, /gwc/rest), the workspace prefix is stripped so GeoWebCacheDispatcher.normalizeURL() works correctly. - CloudGwcUrlHandlerMapping: extends GwcUrlHandlerMapping to fix virtual service URL matching with Spring's PathPattern-based request matching. Updates the cached parsed request path before delegation so workspace-prefixed URLs resolve to the correct controller. Changes to existing classes: - GeoServerTileLayerConfiguration: override getLayers() and getLayer() to filter by LocalWorkspace/LocalPublished thread-local context. This is the common TileLayerConfiguration decorator that wraps all backends, making it the correct abstraction level for virtual service filtering (analogous to upstream CatalogConfiguration.getTileLayerById()). - PgconfigTileLayerCatalog: pass catalog to GeoServerTileLayer constructor so getContextualName() can resolve workspace prefixes without NPE. The backend itself returns all layers unfiltered. - GeoWebCacheCoreConfiguration: replaced inline SetRequestPathInfoFilter with the new GwcRequestPathInfoFilter bean. - GeoWebCacheApplicationConfiguration: calls GwcRequestPathInfoFilter.adaptRequest() before the existing filter. - GeoWebCacheUIAutoConfiguration: added gwcDemoUrlHandlerMapping and gwcRestWebUrlHandlerMapping beans using CloudGwcUrlHandlerMapping. - RESTConfigConfiguration: use CloudGwcUrlHandlerMapping for the WMTS REST URL handler mapping. Includes unit tests for GwcRequestPathInfoFilter and CloudGwcUrlHandlerMapping. Refs: geoserver#767, geoserver#766
groldan
pushed a commit
that referenced
this pull request
Mar 23, 2026
Backport the GWC virtual service URL fix from #767 (main branch) to release/2.28.x, adapted for Spring 5 / javax.servlet. GWC virtual service URLs (e.g. /{workspace}/gwc/service/wmts, /{workspace}/gwc/demo/...) were not properly handled in GeoServer Cloud. The URL handler mapping and request path adaptation did not account for the workspace prefix at the HTTP dispatch level. New classes: - GwcRequestPathInfoFilter: servlet filter that adapts HttpServletRequest for GWC path info handling. For /gwc/service/** paths, the workspace prefix is preserved in the request URI so LocalWorkspaceCallback can detect the workspace. For non-service paths (/gwc/demo, /gwc/rest), the workspace prefix is stripped so GeoWebCacheDispatcher.normalizeURL() works correctly. - CloudGwcUrlHandlerMapping: extends GwcUrlHandlerMapping to fix virtual service URL matching with Spring's PathPattern-based request matching. Updates the cached parsed request path before delegation so workspace-prefixed URLs resolve to the correct controller. Changes to existing classes: - GeoServerTileLayerConfiguration: override getLayers() and getLayer() to filter by LocalWorkspace/LocalPublished thread-local context. This is the common TileLayerConfiguration decorator that wraps all backends, making it the correct abstraction level for virtual service filtering (analogous to upstream CatalogConfiguration.getTileLayerById()). - PgconfigTileLayerCatalog: pass catalog to GeoServerTileLayer constructor so getContextualName() can resolve workspace prefixes without NPE. The backend itself returns all layers unfiltered. - GeoWebCacheCoreConfiguration: replaced inline SetRequestPathInfoFilter with the new GwcRequestPathInfoFilter bean. - GeoWebCacheApplicationConfiguration: calls GwcRequestPathInfoFilter.adaptRequest() before the existing filter. - GeoWebCacheUIAutoConfiguration: added gwcDemoUrlHandlerMapping and gwcRestWebUrlHandlerMapping beans using CloudGwcUrlHandlerMapping. - RESTConfigConfiguration: use CloudGwcUrlHandlerMapping for the WMTS REST URL handler mapping. Includes unit tests for GwcRequestPathInfoFilter and CloudGwcUrlHandlerMapping. Refs: #767, #766
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PathPattern request path for virtual service handler matching
requestURI so GeoWebCacheDispatcher.normalizeURL() works