public class AssetsDispatcher extends Object implements WebDispatcher
All assets are fetched from the classpath and should be located in the resources source root (below the assets directory).
This dispatcher tries to support caching as well as zero-copy delivery of static files if possible.
|Constructor and Description|
|Modifier and Type||Method and Description|
Invoked in order to handle the given request.
Flushes all cached and pre-computed scss / css files.
Returns the priority to determine the position in the dispatcher list.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public int getPriority()
Dispatchers are sorted ascending (lower is better). The default priority is
PriorityCollector.DEFAULT_PRIORITY, the max. value is 998 as everything above
will be handled by the
public boolean dispatch(WebContext ctx) throws Exception
If the dispatcher doesn't feel responsible for handling the request, it simply returns false. Otherwise if the request is being handled, true must be returned
Note that no blocking operation must be performed in this method. For any complex interaction, a new thread
should be forked using
Tasks.executor(String). Note that even
Response.outputStream(io.netty.handler.codec.http.HttpResponseStatus, String) might
block sooner or later to limit heap memory usage - so fork a thread for any serious work besides checking
responsibilities for handling requests.
public void flushCompiledSCSS()
This can be used in environments where the scss files change due to included files. This isn't detected by the framework, as we only check the main file.
Copyright © 2018. All rights reserved.