Rest – jaxrs API vs. jsr311 API vs. javax ws. rs-api vs. jersey-core

For each of the above, I'm a little confused and still confused

This is my understanding of this:

>Jaxrs API: contains only API Not implemented But how is it different from jsr311 > jsr311 API: jsr311 is a specification request This means that it should be a file Why is this a jar? > javax. ws. RS API: is it an implementation? Jersey core (/ Jersey client): it is an implementation of JSR 311

I downloaded each jar and tried to decompile it to see what was in it, but I could only find all the interfaces, not the implementation

I face these problems in the context of repeated warnings generated by the Maven shade plug-in. I need to correctly understand the above contents to determine which errors to exclude and why

Solution

I'll look at this first

Except for the last (Sweatshirt), all these cans are "specification" cans Jax - RS (and many other Java) specifications define contracts (or interfaces) that implementers should implement a specified behavior

Therefore, basically all classes specified in the specification should be used as contracts in jar End users of cans can use them for contracts But it didn't come true You need to actually execute the application, although the API jar specification is sufficient to compile a complete Jax - RS - compliant application

For example, if we have a specification API jar in the classpath, we can create a complete jax-rs application and compile it. However, in order to run it, if we do not have an actual implementation, we need to deploy to a server with the actual implementation of the specification version, such as JBoss or GlassFish

>Jaxrs API – this is the specification for resteasy's packaging It is not an official specification tank, but abides by the specification contract Resteasy uses this jar throughout the specification line, i.e. 1 x – current. Although the jar does change the internal components to comply with different jax-rs versions. > Jsr311 API – this is jax-rs 1 The official specification of line X is jar. > javax. ws. RS API – this is jax-rs 2 The official specification of line X is jar. > Jersey core - this is a partial implementation of the specification The rest of the implementation is contained in other Jersey tanks Note that in earlier versions of Jersey, they actually packaged the Jax - RS specification API into this jar It was not until later that official jars were used

Other resources

>Java API for restful services (jax-rs) read the details of different specification versions. > Complete implementation for RESTeasy distribution. If jax-rs 2 Resteasy 3. X implementation Line x, and jax-rs 1 Resteast 2 of line X x / 1. x id > Complete distribution of Jersey implementation. You can find jax-rs 2.0 in the "Jersey jax-rs 2.0 RI package" link at the top of the page X implementation And the bottom link to Jersey 1 X-ray distribution, which complies with jax-rs 1 X specification

Also note that although different implementations comply with the specification, each implementation has its own set of additional functions To learn more, you should know the documentation for the different implementations The three most popular implementations are Jersey, resteasy, and CXF

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>