我应该使用什么码头罐?

发布于 2024-08-14 03:15:35 字数 304 浏览 1 评论 0原文

我想使用 Jetty 的嵌入式版本创建一个应用程序。不幸的是,我找不到任何关于我需要哪些 jar 文件来执行此操作的信息。 Maven 存储库中有几个(http://repo2.maven.org/ maven2/org/eclipse/jetty/aggregate/)。但是 jetty-server、jetty-server-all 和 jetty-webapp 之间有什么区别?这些是我想要的嵌入式用例吗?

I'd like to create an application using the embedded version of Jetty. Unfortunately, I can't find any information on what jar files I would need to do that. There are several in the maven repository (http://repo2.maven.org/maven2/org/eclipse/jetty/aggregate/). But what's the difference between jetty-server, jetty-server-all, and jetty-webapp? Are any of these what I want for the embedded use case?

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

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

发布评论

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

评论(5

夜巴黎 2024-08-21 03:15:35

我不再收到针对结合 SimplestServer 和 HelloWorldHandler 的 Eclipse 嵌入代码最小示例的编译错误...

http:// wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty

为了实现这一点,我必须在 Eclipse 的 jetty 镜像解压发行版中的 lib 目录中包含以下内容...

  • jetty-server-7.1.4xxxx.jar
  • jetty- util-7.1.4xxxx.jar
  • servlet-api.2.5.jar

I stopped getting compile errors against the Eclipse embedded code minimal example combining SimplestServer and HelloWorldHandler...

http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty

To achieve this I had to include the following from the lib directory in the unzipped distribution from eclipse's jetty mirror...

  • jetty-server-7.1.4xxxx.jar
  • jetty-util-7.1.4xxxx.jar
  • servlet-api.2.5.jar
何其悲哀 2024-08-21 03:15:35

该文档列出了嵌入所需的 JAR 文件,并且非常完整。

http://docs.codehaus.org/display/JETTY/Embedding+Jetty

我相信除非您从 Ant 调用 Jetty,否则您不需要 Ant jar 文件,即使它说您需要它。

一些 JSP jar 文件在二进制包中的命名方式与该文档要求的不同,但本文档有助于确定要使用哪些 Jetty JSP jar:

http://docs.codehaus.org/display/JETTY/JSP+2.0+v+JSP+2.1

This document lists the JAR files required for embedding and is pretty complete.

http://docs.codehaus.org/display/JETTY/Embedding+Jetty

I believe you won't need the Ant jar file unless you're invoking Jetty from Ant, even though it says you need it.

Some of the JSP jar files are named differently in the binary bundle than that document calls for, but this document helps figure out which Jetty JSP jars to use:

http://docs.codehaus.org/display/JETTY/JSP+2.0+v+JSP+2.1

千秋岁 2024-08-21 03:15:35

我使用了jetty-webapp。

I used jetty-webapp.

冷情 2024-08-21 03:15:35

所有依赖项都在此图中得到了最好的解释: http://wiki.eclipse.org/Jetty/参考/依赖项

根据图表,对于嵌入式用例,至少需要 6 个 jar。
例如,对于 Jetty 8,请尝试:

jetty-continuation-8..jar
jetty-http-8.
.jar
jetty-io-8..jar
jetty-server-8.jar
jetty-util-8.*.jar
servlet-api-3.0.jar

All the dependencies are very best explained in this diagram : http://wiki.eclipse.org/Jetty/Reference/Dependencies

Based on the diagram,for embedded use case, a minimum of 6 jars are required.
E.g for Jetty 8, try:

jetty-continuation-8..jar
jetty-http-8.
.jar
jetty-io-8..jar
jetty-server-8.
.jar
jetty-util-8.*.jar
servlet-api-3.0.jar

流年已逝 2024-08-21 03:15:35

为了完整起见,jetty-webapp 的 xml 是:

    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-webapp</artifactId>
        <version>8.1.2.v20120308</version>
    </dependency>

For completeness, the xml for jetty-webapp is;

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