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

JAX-RS – the servlet router

Even if JAX-RS is not fully bound to HTTP and is usable over JMS, WebSockets, and so on, we will just consider the HTTP case here and, more particularly, the case it runs on top of the servlet specification (which is the most common one).

The goal of JAX-RS is to provide a command pattern based on the API to implement the HTTP communications. In other words, it abstracts the I/O with Java modeling. You can see it as a HTTP Java object binding solution. This is what QuoteResource uses.

The role of JAX-RS is to provide all the necessary tooling to make servlet abstraction directly usable for most cases. For this purpose, it provides the following:

  • A routing layer letting developers directly map the request based on its path
  • A serialization layer allowing the conversion of Java objects into HTTP models and streams
  • An exception handling layer enabling the mapping of an exception to an HTTP response
主站蜘蛛池模板: 禹城市| 长寿区| 德昌县| 高尔夫| 东乌珠穆沁旗| 太仆寺旗| 江孜县| 桐梓县| 温泉县| 清流县| 临沧市| 南陵县| 威远县| 镇安县| 芜湖市| 资源县| 原平市| 广饶县| 恩平市| 六枝特区| 讷河市| 临沭县| 靖安县| 肇东市| 阿城市| 都昌县| 临桂县| 南丹县| 名山县| 察隅县| 托里县| 湄潭县| 全州县| 雷州市| 利津县| 多伦县| 福泉市| 合作市| 云和县| 池州市| 宁化县|