Jersey REST Server: instantiating resource classes

后端 未结 2 505
傲寒
傲寒 2020-12-29 12:24

A tutorial on the Jersey REST server [1] says of the Jersey servlet:

This servlet analyzes the incoming HTTP request and selects the correct class and

2条回答
  •  忘掉有多难
    2020-12-29 12:46

    Jersey will establish a new instance of each class per request unless you annotate the class with @Singleton.

    See: https://jersey.java.net/documentation/latest/jaxrs-resources.html#d0e2331

提交回复
热议问题