code: protected ResourceConfig createResourceConfig(WebConfig webConfig)
          throws BeansException
      {
          return WebApplicationContextUtils.getWebApplicationContext(webConfig.getServletContext())
              .getBean(webConfig.getServletConfig().getInitParameter(REST_APPLICATION), ResourceConfig.class);
      }
docs: Creates the resource config.
  
  @param webConfig the web config
  @return the resource config
  @throws BeansException the beans exception