谁能解释一下比赛时会发生什么! app 部署为 war 文件?

发布于 2024-11-28 00:42:01 字数 507 浏览 2 评论 0原文

Play 框架不支持 servlet 规范,但其中有 Play 框架 不支持 servlet 规范。 playframework.org/documentation/1.1/deployment" rel="nofollow">部署选项 可以将整个应用程序打包在一个 war 文件中并将其部署到任何 servlet 容器。

从版本 1.1 开始,play 使用 netty 作为集成 Web 服务器。

我想知道当 play 应用程序部署在 war 文件中时会发生什么。

servlet容器内部仍然使用netty并将其包装起来吗? 它有任何明显的性能成本吗? 或者它只是访问 servlet 容器?

Play framework doesn't support the servlet specification, nevertheless among it's deployment options there's the possibility to package the whole app in a war file and deploy it to any servlet container.

From verson 1.1, play uses netty as integrated web server.

I was wondering what happens when a play app is deployed in a war file.

Does it still uses netty inside the servlet container and wraps it up?
Does it have any noticeable performance cost?
Or it simply acceses the servlet container?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

爱本泡沫多脆弱 2024-12-05 00:42:01

正如 Niels 所说,Play 不使用 Netty 来部署到其他平台。

如果您使用 play runplay start 命令运行 Play,它会使用 Netty 来管理请求,然后将它们传递到 Play 框架。

但是,如果您想部署到另一个应用程序服务器,这是不可能的。因此,Play 将 HTTP 处理包装在 ServletWrapper 周围,这有效地转换了 Play 的正常工作方式,并使其在符合 Servlet 规范的 J2EE 堆栈上可用。

这个包装器的具体代码可以在这里找到< /a>.当您构建 WAR 文件时,play 有效地将这个 ServletWrapper 放置为公开的 Servlet(很像 Struts 对 ActionServlet 所做的那样),并且它处理将请求路由到正确位置的必要工作。

As Niels says, Play does not use Netty for deploying to the other platforms.

If you run Play using the play run or play start commands, it uses Netty to manage the requests, and then pass them on to the Play framework.

If you want to deploy to another application server however, this is not possible. So, Play wraps the HTTP handling around a ServletWrapper, which effectively converts the normal way Play works and makes it available on a J2EE stack conforming to the Servlet specification.

The specific code for this wrapper can be found here. When you build your WAR file, play effectively places this ServletWrapper as the exposed Servlet (much like Struts does with the ActionServlet) and it handles the necessary work to route the request through to the right place.

浅忆流年 2024-12-05 00:42:01

据我所知它不使用netty。它有一个特殊的 servlet,将工作委托给游戏类。只有玻璃鱼有原生的游戏容器。
它对性能有明显的负面影响。

As far as I know it doesn't use netty. It has a special servlet which delegate the work to the play-classes. Only glassfish has a native play-container.
It has obviously negative impact on performance.

佞臣 2024-12-05 00:42:01

正如 this 页面所示,

在 Play 1.2 中,您可以使用 .war使用 play war myapp -o myapp.war 命令创建 文件并部署到该页面中列出的 Java EE 服务器之一。

As this page suggests,

In Play 1.2, You can take the .war file with play war myapp -o myapp.war command and deploy in one of the Java EE Servers listed in that page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文