- 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.
推薦閱讀
- 計算機網絡
- 演進式架構(原書第2版)
- UI圖標創意設計
- 現代C++編程:從入門到實踐
- TypeScript Essentials
- LabVIEW Graphical Programming Cookbook
- JavaScript 網頁編程從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- Mastering KnockoutJS
- Java EE 8 Application Development
- HTML5+CSS3 Web前端開發技術(第2版)
- Akka入門與實踐
- JavaScript Concurrency
- Leaflet.js Essentials
- 劍指大數據:企業級電商數據倉庫項目實戰(精華版)
- HTML5 and CSS3:Building Responsive Websites