如何在 jetty 中设置默认的 webapp Docker

How to set a default webapp in jetty Docker

有没有办法在jetty的Dockerfile中设置默认的webapp?

文档说,您可以将 webapp.war 重命名为 root.war,但如果不想这样做,是否可以将 webapp 指定为默认(且仅)网络应用程序。 我必须修改 Dockerfile 还是可以在 webapp 中指定 (context.xml)

谢谢拉杰什

我猜你想通过使用 <hostname:port> 访问 webapp.war 而没有网络应用名称.. 您可以使用 root/index.html 重定向到您的网络应用程序来进行重定向。 index.html 的内容将是

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <META HTTP-EQUIV="Refresh" CONTENT="0; URL=/<your Web app name>/"/> 
</head>
<body>
</body>

我觉得你可以在project/WEB-INF下创建一个jetty配置文件,你也可以看到http://www.eclipse.org/jetty/documentation/current/configuring-specific-webapp-deployment.html#deployable-descriptor-file