-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to configure Jetty Server v12 ee10 for serving multiple static resources in the same base directory? #11791
Comments
Are there any limitations for Jetty 12 PathSpecs? |
I think we have a bug in I've opened issue #11794. |
Yes, it works in EE9, but I want to know if this bug will be fixed soon in EE10? |
…#11799) * Issue #11791 fix suffix mapping for non default DefaultServlet usage. Co-authored-by: Greg Wilkins <[email protected]>
Thanks for fixing this issue, but I want to know why when I refresh the dependencies, I don't see the new modification in the class DefaultServlet.java |
I'm also having the same problem with static resources index.html. I'm not sure if it's a bug in DefaultServlet or a limitation of PathSpecs, but I'd appreciate it if you could take a look into it.
|
Jetty version(s)
12.0.9
Jetty Environment
ee10
Java Version
JavaSE-17
I am working on a web application using Java, and I have configured servlets to serve static resources using ServletHolder and DefaultServlet. Here is the configuration code:
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
ResourceFactory resourceFactory = ResourceFactory.of(context);
context.setBaseResource(resourceFactory.newResource(mainResourceBase));
ServletHolder holderAlt = new ServletHolder("static-alt", DefaultServlet.class);
holderAlt.setInitParameter("dirAllowed", "true");
holderAlt.setInitParameter("acceptRanges", "true");
context.addServlet(holderAlt, "*.js");
ServletHolder holderDef = new ServletHolder("default", DefaultServlet.class);
holderDef.setInitParameter("dirAllowed", "true");
context.addServlet(holderDef, "/");
i'm encountering a 404 Not Found error when trying to access static resources ending with .js.
I would appreciate any insights or suggestions to help resolve the issue of static resources returning 404 errors.
The text was updated successfully, but these errors were encountered: