我是Spring MVC的新手,我正在尝试一个基本的例子。但我收到Http Stats 404错误。我的文件如下: 这是一个maven项目。请求映射是使用的控制器的一部分,而jsp页面只有list.jsp来显示msg。 errors-HTTP Status 404 - /test1/view/list.jsp
public class ADConfiguration extends WebMvcConfigurerAdapter{
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
System.out.println("hjshjshdjkah");
viewResolver.setViewClass(JstlView.class);
viewResolver.setPrefix("/view/");
viewResolver.setSuffix(".jsp");
registry.viewResolver(viewResolver);
}
@RequestMapping(value = "/list", method = RequestMethod.GET)
public ModelAndView list() {
System.out.println("@@@@@@@@@@@@@@@@@@@@Controller part methods@@@");
String message = "HELLO SPRING MVC HOW R U";
return new ModelAndView("list", "message", message);
}
}