初始的spring项目,没有拦截器过滤器,@RequestMapping等等
页面位置
web.xml如下
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/spring-hibernate.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/**</url-pattern>
</servlet-mapping>
测试url-pattern结果
1、/的情况
.jsp可以打开,.html不能打开
2、/*的情况
都不能打开
3、/**的情况
都能打开
在网上看到的都是说“/”是servlet默认的,可是默认的为什么静态.html也打不开?
“/*”是拦截所有。那“/**”又是什么,怎么全都能打开了
"/**"会出现如下提示信息
八月 18, 2017 4:21:38 下午 org.apache.catalina.core.StandardContext checkUnusualURLPattern
信息: Suspicious url pattern: "/**" in context [] - see sections 12.1 and 12.2 of the Servlet specification
可疑的配置,但是并不会报错,同时还能使用。。。。。。