这个 class "HttpContext" 存在于 glassfish jersey 2.9 中的什么地方?
Where is this class "HttpContext" exist in glassfish jersey 2.9?
glassfish 球衣 2.9
中存在这个 class“HttpContext
”。我使用 jersey 1.17.1
来使用包 com.sun.jersey.api.core.HttpContext
中存在的 HttpContext。
但是我没有在球衣2.9中找到它。
Jersey 2.x 有很多重大变化,部分原因是 JAX-RS 标准在 Jersey 1.x.
中包含了很多东西
引用https://jersey.java.net/documentation/latest/migration.html#mig-1.x
This chapter is a migration guide for people switching from Jersey 1.x. Since many of the Jersey 1.x features became part of JAX-RS 2.0 standard which caused changes in the package names, we decided it is a good time to do a more significant incompatible refactoring, which will allow us to introduce some more interesting new features in the future. As the result, there are many incompatibilities between Jersey 1.x and Jersey 2.0. This chapter summarizes how to migrate the concepts found in Jersey 1.x to Jersey/JAX-RS 2.0 concepts.
迁移章节没有说明 HttpContext 发生了什么,但它不再以旧形式存在。
HttpContext
的直接替换在 Jersey 2.x 版本中不可用,不幸的是,migration guide. Instead of searching for direct replacement, if we dig deeper into the interface HttpContext
, based on the following method summary refer
中的任何地方都没有提到这个重大更改细节
我们可以推断,除了使用 HttpContext
,我们还可以简单地使用以下开箱即用的替代方法。
- 而不是
HttpContext#getRequest
使用 @Context ContainerRequestContext crc
- 而不是
HttpContext#getResponse
使用 @Context ContainerResponseContext crc
- 而不是
HttpContext#getUriInfo
使用 @Context UriInfo uriInfo
- 而不是
HttpContext#getProperties
使用 ContainerRequestContext#getProperty
glassfish 球衣 2.9
中存在这个 class“HttpContext
”。我使用 jersey 1.17.1
来使用包 com.sun.jersey.api.core.HttpContext
中存在的 HttpContext。
但是我没有在球衣2.9中找到它。
Jersey 2.x 有很多重大变化,部分原因是 JAX-RS 标准在 Jersey 1.x.
中包含了很多东西引用https://jersey.java.net/documentation/latest/migration.html#mig-1.x
This chapter is a migration guide for people switching from Jersey 1.x. Since many of the Jersey 1.x features became part of JAX-RS 2.0 standard which caused changes in the package names, we decided it is a good time to do a more significant incompatible refactoring, which will allow us to introduce some more interesting new features in the future. As the result, there are many incompatibilities between Jersey 1.x and Jersey 2.0. This chapter summarizes how to migrate the concepts found in Jersey 1.x to Jersey/JAX-RS 2.0 concepts.
迁移章节没有说明 HttpContext 发生了什么,但它不再以旧形式存在。
HttpContext
的直接替换在 Jersey 2.x 版本中不可用,不幸的是,migration guide. Instead of searching for direct replacement, if we dig deeper into the interface HttpContext
, based on the following method summary
我们可以推断,除了使用 HttpContext
,我们还可以简单地使用以下开箱即用的替代方法。
- 而不是
HttpContext#getRequest
使用@Context ContainerRequestContext crc
- 而不是
HttpContext#getResponse
使用@Context ContainerResponseContext crc
- 而不是
HttpContext#getUriInfo
使用@Context UriInfo uriInfo
- 而不是
HttpContext#getProperties
使用ContainerRequestContext#getProperty