public class SpaBundle
extends java.lang.Object
implements io.dropwizard.Bundle
Bundle is pure dropwizard bundle.
Use dropwizard-assets servlet internally, but wraps it with special filter, which reacts on resource not found errors (by default, all calls pass to assets filter!). Applies no-cache header for index page.
You can register multiple SPA applications on main or admin contexts (or both). All applications must have unique names. In case of duplicate names or mapping on the same path, error will be thrown.
| Modifier and Type | Class and Description |
|---|---|
static class |
SpaBundle.Builder
Spa bundle builder.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_PATTERN |
static java.lang.String |
SLASH |
| Constructor and Description |
|---|
SpaBundle() |
| Modifier and Type | Method and Description |
|---|---|
static SpaBundle.Builder |
adminApp(java.lang.String name,
java.lang.String resourcePath,
java.lang.String uriPath)
Register SPA application in admin context.
|
static SpaBundle.Builder |
app(java.lang.String name,
java.lang.String resourcePath,
java.lang.String uriPath)
Register SPA application in main context.
|
void |
initialize(io.dropwizard.setup.Bootstrap<?> bootstrap) |
void |
run(io.dropwizard.setup.Environment environment) |
public static final java.lang.String SLASH
public static final java.lang.String DEFAULT_PATTERN
public void initialize(io.dropwizard.setup.Bootstrap<?> bootstrap)
initialize in interface io.dropwizard.Bundlepublic void run(io.dropwizard.setup.Environment environment)
run in interface io.dropwizard.Bundlepublic static SpaBundle.Builder app(java.lang.String name, java.lang.String resourcePath, java.lang.String uriPath)
name - application name (used as servlet name)resourcePath - path to application resources (classpath)uriPath - mapping uripublic static SpaBundle.Builder adminApp(java.lang.String name, java.lang.String resourcePath, java.lang.String uriPath)
name - application name (used as servlet name)resourcePath - path to application resources (classpath)uriPath - mapping uri