add core view extension with JTE and Thymeleaf support
This commit is contained in:
@@ -10,7 +10,7 @@ package dev.relism;
|
||||
* <p>Dev mode enables:
|
||||
* <ul>
|
||||
* <li>HTML error pages with full stack traces (default: JSON generic responses in prod)</li>
|
||||
* <li>Template cache disabled in {@code flash-ext-view}</li>
|
||||
* <li>Template cache disabled in {@code flash-ext-view-thymeleaf}</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>Extensions can read {@link #DEV} to branch behavior without re-implementing the detection:
|
||||
|
||||
@@ -31,7 +31,7 @@ public final class FlashScope extends FlashRegistrar<FlashScope> {
|
||||
private final List<RouteDefinition> deferredRoutes = new ArrayList<>();
|
||||
|
||||
FlashScope(String namespace, FlashContext parentCtx) {
|
||||
this.namespace = namespace;
|
||||
this.namespace = PathUtils.sanitize(namespace);
|
||||
this.ctx = parentCtx.child();
|
||||
}
|
||||
|
||||
@@ -54,5 +54,5 @@ public final class FlashScope extends FlashRegistrar<FlashScope> {
|
||||
|
||||
List<RouteDefinition> routes() { return deferredRoutes; }
|
||||
|
||||
private String ns(String path) { return namespace + PathUtils.sanitize(path); }
|
||||
private String ns(String path) { return PathUtils.join(namespace, path); }
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ class PathUtilsTest {
|
||||
void join_withRootBase_returnsSanitizedPath() {
|
||||
assertEquals("/users", PathUtils.join("/", "/users/"));
|
||||
assertEquals("/users", PathUtils.join("/", "users"));
|
||||
assertEquals("/blogs", PathUtils.join("/", "/blogs"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user