一、Tomcat的介绍和安装配置

安装tomcat:



环境变量的配置:

配置之后重启cmd,执行startup命令,启动tomcat

在localhost:8080,能进入tomcat主界面,说明配置成功

二、eclipse中动态web项目的创建和运行
tomcat可以在面板上配,可以去windows中preferences配,也可以在创建项目的时候配
windows中preferences配:

面板上配:

调出servers

创建web项目(Dynamic Web Project):


2021年之前:

2021年之后:

三、使用IDEA创建web项目并运行

创建web项目:可以选Java,也可以选择Java Enterprise,勾上Web Application


添加tomcat服务:




启动tomcat服务,运行代码:
