Programmatically create a REST service

I am trying to create a REST service, but the service should not be "static", but dynamically / programmatically created. I already know how to create a REST service using Spring and JAX-RS, but I don’t know how to use it dynamically.

My intention is to create annotations to do some markup in the source code, and then use that markup to create a REST service from it (at application startup time). The service does not need to be changed at runtime.

Is it possible to use Spring or JAX-RS features at runtime, or do I need to completely start from the beginning, for example, using servlets?

Do you have any suggestion on how to solve the problem. Libraries / Frames such as Spring or JAX-RS would be preferable.

+4
source share
1 answer

A good common way is to use Spring for the backend and Jersey for the REST endpoints (as pointed out in the comments to @peeskillet). Here is a simple beginner tutorial that may be helpful.

You can also try Spring MVC .

Here is a good guide from the Spring website: Creating REST Services with Spring .

0
source

All Articles