官术网_书友最值得收藏!

  • Jakarta EE Cookbook
  • Elder Moraes
  • 98字
  • 2021-06-24 16:12:36

Getting ready

Let's start by adding the right dependency to our project:

<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-grizzly2-http</artifactId>
<version>2.28</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>2.28</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-sse</artifactId>
<version>2.28</version>
</dependency>
</dependencies>

You surely noticed that we are using Jersey here. Why? Because Jersey is one of the reference implementations for JAX-RS, which means that it implements all JAX-RS specifications.

Moreover, with Jersey, we can use Grizzly to start a small local server, which will be useful for this recipe, as we need just a few server features to show the SSE behavior.

Further on in this book, we will use a full GlassFish to build more JAX-RS recipes.

主站蜘蛛池模板: 天全县| 兴国县| 墨江| 黄骅市| 巴楚县| 永修县| 新津县| 邹城市| 汾西县| 南溪县| 浦东新区| 从江县| 台南市| 德庆县| 财经| 杭州市| 新化县| 江华| 绥化市| 石狮市| 岳池县| 淄博市| 丰顺县| 连城县| 阿拉善右旗| 台安县| 灵石县| 兴安盟| 金坛市| 舒兰市| 家居| 资中县| 高州市| 吉林省| 苗栗县| 连江县| 炎陵县| 和顺县| 洪湖市| 巨鹿县| 会泽县|