سؤال

I am attempting to answer this question: What is the Jersey 2 replacement for ResourceContext.matchResource(URI)?

I've managed to navigate from a ResourceModel to a matching Resource, but it's not clear how to instantiate the corresponding user class.

Meaning, given org.glassfish.jersey.server.model.Resource that maps to some user-defined class CompaniesResource, how do I get a CompaniesResource instance out of the Resource?

The tricky part is that this needs to invoke subresource locators with values parsed from the URI.

هل كانت مفيدة؟

المحلول

Answering my own question:

Take a look at createResource found at https://stackoverflow.com/a/23620747/14731

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top