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

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
主站蜘蛛池模板: 北碚区| 绥阳县| 延安市| 新绛县| 浑源县| 元氏县| 宁夏| 安义县| 龙江县| 龙山县| 新余市| 灵寿县| 当阳市| 青冈县| 广西| 仙桃市| 张家口市| 重庆市| 神木县| 开平市| 泰州市| 建水县| 无极县| 普兰店市| 齐齐哈尔市| 赞皇县| 永吉县| 恩平市| 黑水县| 富民县| 海晏县| 宁晋县| 禄劝| 天气| 扎兰屯市| 东至县| 肥西县| 松阳县| 石家庄市| 宁国市| 湘西|