Instantiation
REST resources are deployed in one of two ways:
When deployed in a J2EE container, you MUST extend from one of the servlet classes.
When deployed as a child of another resource, you MAY extend from one of the servlet classes but it's
not necessary.
The only requirement is that the class be annotated with
And even that requirement is relaxed if you implement your own REST resource resolver (described later).
For example:
That's all there is to it! There's no code scanning, module configuration/initialization classes, or anything complex like that. It's just a servlet.