public class SSIHandler extends AssetHandler
Custom AssetHandler
with server side include
function.
{
get("/static/**", new SSIHandler());
}
Request to /static/index.html
:
<html> <-- /static/chunk.html --> </html>
The SSIHandler
will resolve and insert the content of /static/chunk.html
.
Default delimiter are: <--
and -->
. You can override this using
delimiters(String, String)
function:
{
get("/static/**", new SSIHandler().delimiters("{{", "}}");
}
Constructor and Description |
---|
SSIHandler()
Creates a new
SSIHandler . |
SSIHandler(String pattern)
Creates a new
SSIHandler . |
Modifier and Type | Method and Description |
---|---|
SSIHandler |
delimiters(String start,
String end)
Set/override delimiters.
|
cdn, etag, handle, lastModified, maxAge, maxAge, maxAge, onMissing
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handle
public SSIHandler(String pattern)
Creates a new SSIHandler
. The location pattern can be one of.
/
like in assets("/assets/**", "/")
with:
GET /assets/js/index.js it translates the path to: /assets/js/index.jsGiven
/assets
like in assets("/js/**", "/assets")
with:
GET /js/index.js it translate the path to: /assets/js/index.jsGiven
/META-INF/resources/webjars/{0}
like in
assets("/webjars/**", "/META-INF/resources/webjars/{0}")
with:
GET /webjars/jquery/2.1.3/jquery.js it translate the path to: /META-INF/resources/webjars/jquery/2.1.3/jquery.js
pattern
- Pattern to locate static resources.public SSIHandler()
Creates a new SSIHandler
. Location pattern is set to: /
.
public SSIHandler delimiters(String start, String end)
start
- Start delimiter.end
- Stop/end delimiter.Copyright © 2019. All rights reserved.