Class SpaIndexTransformer
java.lang.Object
org.operaton.bpm.spring.boot.starter.webapp.neo.SpaIndexTransformer
- All Implemented Interfaces:
org.springframework.web.servlet.resource.ResourceTransformer
public class SpaIndexTransformer
extends Object
implements org.springframework.web.servlet.resource.ResourceTransformer
Rewrites the
<base href> of the SPA shell to the application root, so the
bundle can be served from a sub-path.
Nothing in the bundle can know its own prefix at build time: it is the sum of the
servlet context path (known per request) and
operaton.bpm.webapp.neo.application-path. The one place a browser reads a
prefix from is <base href>, so the server states it here and everything the
SPA emits — assets, locales, routes — hangs off it.
Only index.html is transformed; every other resource passes through
untouched.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringappRoot(jakarta.servlet.http.HttpServletRequest request) The application root as the browser must see it: context path + application path, with a trailing slash so relative URLs resolve inside the app rather than beside it.org.springframework.core.io.Resourcetransform(jakarta.servlet.http.HttpServletRequest request, org.springframework.core.io.Resource resource, org.springframework.web.servlet.resource.ResourceTransformerChain transformerChain)
-
Field Details
-
INDEX_HTML
- See Also:
-
BASE_TAG
The<base href="...">the frontend build emits (seeindex.html). -
applicationPath
-
-
Constructor Details
-
SpaIndexTransformer
-
-
Method Details
-
transform
public org.springframework.core.io.Resource transform(jakarta.servlet.http.HttpServletRequest request, org.springframework.core.io.Resource resource, org.springframework.web.servlet.resource.ResourceTransformerChain transformerChain) throws IOException - Specified by:
transformin interfaceorg.springframework.web.servlet.resource.ResourceTransformer- Throws:
IOException
-
appRoot
The application root as the browser must see it: context path + application path, with a trailing slash so relative URLs resolve inside the app rather than beside it.
-