terjekid commented on code in PR #3648:
URL: https://github.com/apache/avro/pull/3648#discussion_r2812523480
##########
lang/java/ipc-jetty/src/main/java/org/apache/avro/ipc/jetty/StatsServer.java:
##########
@@ -42,11 +46,24 @@ public StatsServer(StatsPlugin plugin, int port) throws
Exception {
this.httpServer = new Server(port);
this.plugin = plugin;
- ServletHandler handler = new ServletHandler();
- httpServer.setHandler(handler);
- handler.addServletWithMapping(new ServletHolder(new StaticServlet()), "/");
+ ServletContextHandler servletContext = new
ServletContextHandler(ServletContextHandler.SESSIONS);
+ servletContext.setContextPath("/");
- handler.addServletWithMapping(new ServletHolder(new StatsServlet(plugin)),
"/");
+ ServletHolder servletHolder = new ServletHolder(new StatsServlet(plugin));
+ servletContext.addServlet(servletHolder, "/");
+
+ ResourceHandler resourceHandler = new ResourceHandler();
+
resourceHandler.setBaseResource(Resource.newClassPathResource("/org/apache/avro/ipc/stats/static"));
Review Comment:
@martin-g I've added a default check and only initialize the static resource
handler when the resource folder is available.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]