spring mvc请求不可用错误

时间:2015-07-11 03:47:47

标签: spring spring-mvc

    @Bean
        public ViewResolver viewResolver()
        {
            InternalResourceViewResolver resolver=new InternalResourceViewResolver();
            resolver.setPrefix("WEB-INF/views");
            resolver.setSuffix(".jsp");
            resolver.setExposeContextBeansAsAttributes(true);
            return resolver;
        }

    @RequestMapping(value="/events/{id}")
        public String showEvent(@PathVariable("id") int id)
        {
            return "/events/show";
        }

o/p: when i use url: http://localhost:8080/tracker/events/1
HTTP Status 404 - /tracker/events/WEB-INF/views/events/show.jsp
type Status report
message /tracker/events/WEB-INF/views/events/show.jsp
description The requested resource is not available.
Apache Tomcat/7.0.56

我使用带有java配置和注释的spring 4.1。配置有什么问题吗?

0 个答案:

没有答案