I\'m just getting acquainted with implementing REST web services in Java using JAX-RS and I ran into the following problem. One of my resource classes requires access to a s
If anyone is using Resteasy this is what worked for me.
If you add something like this:
ResteasyContext.pushContext(StorageEngine.class, new StorageEngine());
into something like a jaxrs filter, it allows you to do something like this:
@GET
@Path("/some/path")
public Response someMethod(@Context StorageEngine myStorageEngine) {
...
}
This is specific to Resteasy, which doesn't have something like SingletonTypeInjectableProvider
.