Skip to content

Instantly share code, notes, and snippets.

@cescoffier
Created October 5, 2015 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cescoffier/98adde5c26c52f0c16e3 to your computer and use it in GitHub Desktop.
Save cescoffier/98adde5c26c52f0c16e3 to your computer and use it in GitHub Desktop.
router.get("/assets/*").handler(ctxt -> {
final ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
LOGGER.info("Handling " + ctxt.normalisedPath());
Thread.currentThread().setContextClassLoader(VertxWebApplication.class.getClassLoader());
ctxt.next();
} finally {
Thread.currentThread().setContextClassLoader(original);
}
});
router.get("/assets/*").handler(StaticHandler.create("assets"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment