@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。配置有什么问题吗?