Class SpaResourceResolver
java.lang.Object
org.springframework.web.servlet.resource.AbstractResourceResolver
org.springframework.web.servlet.resource.PathResourceResolver
org.operaton.bpm.spring.boot.starter.webapp.neo.SpaResourceResolver
- All Implemented Interfaces:
org.springframework.web.servlet.resource.ResourceResolver
public class SpaResourceResolver
extends org.springframework.web.servlet.resource.PathResourceResolver
Resolves static resources for the webapps-neo SPA and falls back to
index.html for client-side routes (deep links) so the single-page
application can take over routing.
The fallback only applies to paths that look like application routes: paths that resolve to an actual file are served directly, requests for the API namespaces are left to 404, and requests that carry a file extension (i.e. a missing static asset) are not masked by the HTML shell.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringRequest prefixes that must never be answered with the SPA shell.Fields inherited from class org.springframework.web.servlet.resource.AbstractResourceResolver
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.core.io.ResourcegetResource(String resourcePath, org.springframework.core.io.Resource location) protected booleanisClientRoute(String resourcePath) Methods inherited from class org.springframework.web.servlet.resource.PathResourceResolver
checkResource, getAllowedLocations, getLocationCharsets, getUrlPathHelper, resolveResourceInternal, resolveUrlPathInternal, setAllowedLocations, setLocationCharsets, setUrlPathHelperMethods inherited from class org.springframework.web.servlet.resource.AbstractResourceResolver
resolveResource, resolveUrlPath
-
Field Details
-
INDEX_HTML
- See Also:
-
RESERVED_PREFIXES
Request prefixes that must never be answered with the SPA shell.
-
-
Constructor Details
-
SpaResourceResolver
public SpaResourceResolver()
-
-
Method Details
-
getResource
protected org.springframework.core.io.Resource getResource(String resourcePath, org.springframework.core.io.Resource location) throws IOException - Overrides:
getResourcein classorg.springframework.web.servlet.resource.PathResourceResolver- Throws:
IOException
-
isClientRoute
-