SPRING MVC - 拒绝的bean名称'SVGParser':未标识URL路径

时间:2016-03-01 16:51:33

标签: java spring spring-mvc

我在AppConfig中添加了一个Bean,从现在开始我得到所有拒绝的bean名称'xxxxxxxx':部署应用程序时没有识别出URL路径......

我不知道我做错了什么,这是我的AppConfig.class

@Configuration
@EnableWebMvc
@ComponentScan("it.beingsmart")

public class AppConfig extends WebMvcConfigurerAdapter{


    @Bean
    public ViewResolver viewResolver() {
        InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
        viewResolver.setViewClass(JstlView.class);
        viewResolver.setPrefix("/WEB-INF/pages/");
        viewResolver.setSuffix(".jsp");
        return viewResolver;
    }

    @Bean
    public MessageSource messageSource() {
        ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
        messageSource.setBasename("messages");
        return messageSource;
    }


    @Override
    public void addResourceHandlers(final ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
    }

    @Bean(name = "multipartResolver")
    public StandardServletMultipartResolver resolver() {
        return new StandardServletMultipartResolver();
    }

    @Bean
    public SVGParser parser(){
        return new SVGParser();
    }

我添加了SVGParser,因为我在控制器中自动装配它

@Autowired
SVGParser parser;

我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

消息:

Rejected bean name 'xxxxxxxx': no URL paths identified when deploying the application...

是调试消息,完全没有问题。有关更多详细信息,请参阅我的其他答案: