tomcat设置缺省应用、默认访问页面

缺省应用

ROOT其实就是缺省应用,http://localhost/app7/1.html,此时你的tomcat中并没有去配置一个/app7的应用,这个时候这个请求你打算怎么办?所以此时它会交给缺省ROOT应用来处理。保底。访问ROOT应用下面的资源时,直接把应用名去掉即可。

http://localhost/index.jsp

默认访问页面

如果请求中没有指明具体的访问页面,那实际上访问的时默认页面,缺省页面。这个时在tomcat的web.xml中进行配置的

<welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

实际上如果请求的url并没有指明访问的具体资源,那么就会在当前应用下去寻找这些welcome-file,如果找到,则加载,如果找不到则返回404.

http://localhost

猜你喜欢

转载自blog.csdn.net/gy99csdn/article/details/114177089
今日推荐