社区版 IDEA 开发webapp 配置tomcat

1.安装tomcat

参考Tomcat配置_tomcat怎么配置成功-优快云博客

2.构建webapp项目结构

新建一个普通项目

然后添加webapp的目录结构:

main目录下新建 webapp 文件夹

webapp文件夹下新建WEB_INF文件夹

*WEB_INF目录下新建web.xml

wenapp文件夹下再新建index.html

test目录下新建 resources

web.xml内容

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="4.0"
         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">
    <display-name>xss</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
</web-app>

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>检测是否成功</title>
</head>
<body>
<h3>Hello</h3>
</body>
</html>

3.安装tomcat插件

4.配置tomcat

Name: 随便写

Deployment directory: 选到你的项目的webapp目录

Context path: 你访问网页的路径,可以就写 “/”  

5.添加tomcat包依赖

选择你本地的tomcat安装包下的lib

5.运行

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值