怎么设置webapp下的index.html为首页呢
来源:2-1 URL Mapping(URL映射)
qq_森林中的小熊_0
2019-11-21 17:21:33
怎么设置webapp下的index.html为首页呢,我必须http://localhost/index.html这么输入才能进入首页,但视频里面http://localhost这样进去直接就是index.html的页面了
1回答
同学你好!
默认情况下,tomcat启动之后是会访问项目下的index.html页面的,其实老师那里什么都没有设置呢。如果同学那里不可以,可以在web.xml中添加以下配置测试一下,可以重启idea试一下
<welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list>
如果我的回答解决了你的疑惑,请采纳,祝学习愉快~
相似问题