Idea部署tomcat的根目录

最近想用Idea创建web项目,需要部署tomcat,照着网上的教程部署后,不知道项目的根目录是那个,导致项目的index.jsp无法访问到。
如图,我在WEB-INF下创建了views文件夹·,在views文件夹下创建了index.jsp,这样web.xml文件的welcome-file配置路径不知道怎么写。
这里写图片描述

最后在工程目录下的.idea/artifacts下找到了部署文件exploded.xml
这里写图片描述

文件中的output-path直接指明了根目录
这里写图片描述

这里写图片描述

所以web.xml文件中welcome-file配置为

    <welcome-file-list>
        <welcome-file>\WEB-INF\views\index.jsp</welcome-file>
    </welcome-file-list>

猜你喜欢

转载自blog.csdn.net/caser_hdmi/article/details/78378435