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

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.

主站蜘蛛池模板: 休宁县| 定州市| 多伦县| 富阳市| 宜兴市| 汪清县| 综艺| 黑山县| 阿拉善盟| 娱乐| 武宁县| 南涧| 大石桥市| 衡山县| 合水县| 乌什县| 乡宁县| 平武县| 岚皋县| 陆河县| 塘沽区| 蕉岭县| 山丹县| 阿荣旗| 天长市| 霍林郭勒市| 长寿区| 惠来县| 锡林郭勒盟| 烟台市| 资兴市| 云南省| 昌吉市| 和硕县| 马尔康县| 唐海县| 霸州市| 鄱阳县| 林甸县| 娄烦县| 凌云县|