*/
private static ResourceConfig createResourceConfig(final WebConfig config) throws ServletException {
final ServletContext servletContext = config.getServletContext();
// check if ResourceConfig has already been created, if so use it
ResourceConfig resourceConfig = Utils.retrieve(config.getServletContext());
if (resourceConfig != null) {
return resourceConfig;
}
final Map<String, Object> initParams = getInitParams(config);
final Map<String, Object> contextParams = Utils.getContextParams(servletContext);
// check if the JAX-RS application config class property is present
final String jaxrsApplicationClassName = config.getInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS);
if (jaxrsApplicationClassName == null) {
// If no resource config class property is present, create default config
resourceConfig = new ResourceConfig().addProperties(initParams).addProperties(contextParams);
final String webApp = config.getInitParameter(ServletProperties.PROVIDER_WEB_APP);
if (webApp != null && !"false".equals(webApp)) {
resourceConfig.registerFinder(new WebAppResourcesScanner(servletContext));
}
return resourceConfig;
}
try {