Skip to content

Commit

Permalink
Fjerne alias-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jolarsen committed Dec 8, 2023
1 parent 7c6f55d commit ba943ca
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,17 @@ private ContextHandler createContext() throws IOException {

// må hoppe litt bukk for å hente web.xml fra classpath i stedet for fra filsystem.
String descriptor;
String baseResource;
try (var factory = ResourceFactory.closeable()) {
var resource = factory.newClassLoaderResource("/WEB-INF/web.xml", false);
descriptor = resource.getURI().toURL().toExternalForm();
baseResource = factory.newResource(".").getRealURI().toURL().toExternalForm();
}
ctx.setDescriptor(descriptor);

ctx.setContextPath(CONTEXT_PATH);
ctx.setBaseResourceAsString(".");
ctx.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");
ctx.setBaseResourceAsString(baseResource);
ctx.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false"); // Default servlet convention
ctx.setInitParameter("pathInfoOnly", "true");

// Scanns the CLASSPATH for classes and jars.
Expand Down

0 comments on commit ba943ca

Please sign in to comment.