Skip to content

Commit

Permalink
Migrate js plugins to ResourceServlet
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 committed Sep 10, 2024
1 parent 0e48ea1 commit d45a99f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.eclipse.jetty.ee10.servlet.DefaultServlet;
import org.eclipse.jetty.ee10.servlet.ErrorPageErrorHandler;
import org.eclipse.jetty.ee10.servlet.FilterHolder;
import org.eclipse.jetty.ee10.servlet.ResourceServlet;
import org.eclipse.jetty.ee10.servlet.ServletHolder;
import org.eclipse.jetty.ee10.servlet.security.ConstraintSecurityHandler;
import org.eclipse.jetty.ee10.webapp.WebAppContext;
Expand Down Expand Up @@ -365,11 +366,11 @@ public void onClosed(Connection connection) {
}

private static ServletHolder servletHolder(String name, URI filesystemUri) {
final ServletHolder jsPlugins = new ServletHolder(name, DefaultServlet.class);
final ServletHolder jsPlugins = new ServletHolder(name, ResourceServlet.class);
// Note, the URI needs explicitly be parseable as a directory URL ending in "!/", a requirement of the jetty
// resource creation implementation, see
// org.eclipse.jetty.util.resource.Resource.newResource(java.lang.String, boolean)
jsPlugins.setInitParameter("resourceBase", filesystemUri.toString());
jsPlugins.setInitParameter("baseResource", filesystemUri.toString());
jsPlugins.setInitParameter("pathInfoOnly", "true");
jsPlugins.setInitParameter("dirAllowed", "false");
jsPlugins.setAsyncSupported(true);
Expand Down

0 comments on commit d45a99f

Please sign in to comment.