创建一个web工程
创建web工程
idea中创建的web工程部署到tomcat上
idea关联tomcat、
项目部署到tomcat上
idea启动tomcat
访问tomcat下项目中指定的资源
http://服务器ip:8080/上下文路径/资源名称
设置默认首页
默认打开的资源。
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<!--设置默认页面: 先查找main.jsp是否存在 如果存在,则显示main.jsp,否则显示index.jsp-->
<welcome-file-list>
<welcome-file>main.jsp</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>