protected void injectResources(Object instance) {
if (instance != null) {
ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
List<ResourceResolver> resolvers = resourceManager.getResourceResolvers();
resourceManager = new DefaultResourceManager(resolvers);
resourceManager.addResourceResolver(new WebContextResourceResolver());
ResourceInjector injector = new ResourceInjector(resourceManager);
injector.inject(instance);
}
}