PLTF-1110: explicit static path
This commit is contained in:
parent
53a6553765
commit
48ffb76a4d
1 changed files with 8 additions and 1 deletions
|
@ -23,6 +23,9 @@ public class StaticController {
|
|||
@Value("classpath:static/manifest.json")
|
||||
private Resource manifestFile;
|
||||
|
||||
@Value("#{environment.STATIC_PATH}")
|
||||
private String staticPath;
|
||||
|
||||
private final AtomicReference<String> renderedIndexFile = new AtomicReference<>();
|
||||
private final AtomicReference<String> renderedManifestFile = new AtomicReference<>();
|
||||
|
||||
|
@ -39,7 +42,11 @@ public class StaticController {
|
|||
public String getRenderedFile(ServerWebExchange exchange, AtomicReference<String> renderedFile, Resource file) {
|
||||
String rendered = renderedFile.get();
|
||||
if (rendered == null) {
|
||||
rendered = buildFile(file, exchange.getRequest().getPath().contextPath().value());
|
||||
String contextPath = staticPath;
|
||||
if (contextPath == null) {
|
||||
contextPath = exchange.getRequest().getPath().contextPath().value();
|
||||
}
|
||||
rendered = buildFile(file, contextPath);
|
||||
if (renderedFile.compareAndSet(null, rendered)) {
|
||||
return rendered;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue