我有https://stackoverflow.com/a/28735121/5030226的代码。它服务于目录但是当我打开一个html文件。它会引发内部服务器错误。 请帮忙..
Server server = new Server(8080);
ServletContextHandler context = new
ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
DefaultServlet defaultServlet = new DefaultServlet();
ServletHolder holderPwd = new ServletHolder("default", defaultServlet);
holderPwd.setInitParameter("resourceBase", "./src/webapp/");
context.addServlet(holderPwd, "/*");
server.setHandler(context);
server.start();