我想在 Grizzly 2 上运行 JAX-RS 2.0/Jersey,但我现在不知道如何设置它。我发现了以下 Maven 依赖项:
<dependency>
<groupId>org.glassfish.grizzly</groupId>
<artifactId>grizzly-framework</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0-m09</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<version>2.0-m05-1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.0-m05-1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-grizzly2-http</artifactId>
<version>2.0-m05-1</version>
</dependency>
我需要什么 Java 代码才能在 Grizzly 上运行 Jersey?
最佳答案
这展示了如何从 Maven 原型(prototype)创建项目的骨架(它有一些基本代码):http://jersey.java.net/nonav/documentation/snapshot/getting-started.html#new-from-archetype
您还可以在此处浏览 Jersey 2 示例:https://github.com/jersey/jersey/tree/master/examples
其中大多数都是灰熊。
关于java - 在 Grizzly 2 上运行 JAX-RS 2.0/Jersey,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11619936/