如何将静态html资源添加到Grizzly 2.2服务器?我试过了
val server = GrizzlyHttpServerFactory.createHttpServer(uri, new ResourceConfig())
val statichandler = new StaticHttpHandler()
statichandler.addDocRoot("/webapp")
statichandler.start
server.getServerConfiguration.addHttpHandler(statichandler)
server.startwebapp文件夹位于maven项目的src/main/resource中。
发布于 2012-11-14 06:49:41
尝试:
val statichandler = new StaticHttpHandler(<path>, "/webapp");
server.getServerConfiguration.addHttpHandler(statichandler);其中,<path>是您希望提供服务的资源的绝对路径。
https://stackoverflow.com/questions/12528324
复制相似问题