当前位置: 首页 > article >正文

社区版 IDEA 开发webapp 配置tomcat

1.安装tomcat

参考Tomcat配置_tomcat怎么配置成功-CSDN博客

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.运行


http://www.kler.cn/a/444445.html

相关文章:

  • C# 方法的参数主要有四种类型:值参数、引用参数ref 、输出参数out、可变参数params
  • React 项目引入 svg 图片为 undefined 情况
  • SpringBoot自己写的maven项目-配置文件提示
  • java Kafka批量消费和单个消费消息
  • SQL 查询方式比较:子查询与自连接
  • LabVIEW与PLC点位控制及OPC通讯
  • 如何处理对象的状态变化?如何实现工厂模式?
  • 如何实现一套完整的CI/CD?
  • 当我用影刀AI Power做了一个旅游攻略小助手
  • 【Javaweb】第一篇上,什么是web?
  • 密码生成器:随机密码在线生成,保障您的数字安全
  • Unity3D实现迷宫Game(第一人称视角)
  • 从零开始学TiDB(6)深入学习Placement Driver(PD)
  • XXE靶场
  • 无人预见的人工智能创业大难题
  • 【第九节】Git 服务器搭建
  • ExcelVBA编程输出ColorIndex与对应颜色色谱
  • 在 Spring Boot 3 中实现基于角色的访问控制
  • 每天40分玩转Django:实操博客应用
  • 基于Matlab实现三维地球模型(源码)