public interface StaticResourceHandler
Configure the serving of static resources
| Type Params | Return Type | Name and description |
|---|---|---|
|
public StaticResourceHandler |
cacheControl(java.lang.String headerValue)Set a custom Cache-Control header. |
|
public StaticResourceHandler |
dirAllowed(boolean allowed)Allow/disallow directory listing |
|
public StaticResourceHandler |
maxAge(java.time.Duration duration)Sets a Cache-Control header of max-age={duration},private. |
|
public StaticResourceHandler |
name(java.lang.String name)Sets the name of the underlying Servlet so that it can be accessed via ctx.request().getServletContext().getNamedDispatcher({name}) |
Set a custom Cache-Control header. Use either this or maxAge(Duration)
headerValue - A value for the Cache-Control header. See here for some examples.Allow/disallow directory listing
allowed - Boolean flag Sets a Cache-Control header of max-age={duration},private. Use cacheControl(String) if you need to set a
more detailed header value.
duration - The time period to cache assets Sets the name of the underlying Servlet so that it can be accessed via ctx.request().getServletContext().getNamedDispatcher({name})
name - The desired name for the underlying Servlet