application.xml與工程配置:
index.jsp在webapp下,可以直接請求。
配置還有:<mvc:annotation-driven></mvc:annotation-driven>
web.xml配置DispatcherServlet攔截/*時,index.jsp請求被攔截
配置mvc:resource,此時路徑是/WEB-INF/Page/index.jsp,顯示404
去掉mvc:resource配置,DispatcherServlet攔截/*,JSP被通配符的Spring攔截
這時路徑:localhost:8080/index.jsp,真實路徑:/index.jsp 路徑沒有被映射,可對index.jsp請求
經過Spring攔截,但請求資源存在,顯示效果,做靜態資源下發了:
web.xml配置DispatcherServlet攔截/,jsp沒被Spring攔截,發起訪問,進入index.jsp,頁面正常顯示。