在不同的ide开发工具中使用 tomcat 部署 项目

一、在 idea中使用 tomcat

  • 添加运行配置

1-在开发工具中使用tomcat

  • 选择添加运行配置为 tomcat 服务器

1-在开发工具中使用tomcat

  • 配置服务器

1-在开发工具中使用tomcat

  • 继续配置服务器,选择部署项目

1-在开发工具中使用tomcat
1-在开发工具中使用tomcat

  • 切换到发布标签页:

1-在开发工具中使用tomcat

  • 点击 + ,添加部署的项目及设置部署项目名(即服务器根目录/项目名主目录 构成访问首页)、设置项目访问名(可选)

1-在开发工具中使用tomcat

  • 最后如下:

1-在开发工具中使用tomcat

  • 如果设置了项目名 /ssm ,那么首页访问便是 http://localhost:80803/ssm/index.html (先保证你的maven web 的 webapps 有 index.html文件)

  • 访问效果

1-在开发工具中使用tomcat

二、在eclipse 中配置 tomcat 服务器并运行

比idea简单多了,只需要 file -> add server (搜索server),添加指定版本的tomcat服务器,然后 add and remove 添加或者移除 war 包即可,然后点击 server 运行即可。

  • 添加 server
    1-在开发工具中使用tomcat

  • 在wizard(向导)中搜索 server

1-在开发工具中使用tomcat

  • 选择 tomcat 服务器

1-在开发工具中使用tomcat

  • 导入本地 tomcat,选择 jre版本

1-在开发工具中使用tomcat

  • 之后弹出 server 窗口(不见了的话 window - show view 打开),右键server,add and remove

1-在开发工具中使用tomcat

  • 自行决定移除、添加 要部署的war包
    1-在开发工具中使用tomcat

  • 可以启动 服务器了(静态资源文件修改后不需要重新启动,class、xml等文件需要重新启动(也可以等server 自行加载,控制台会有提示))

    • 访问首页(localhost:8081 是 tomcat 的端口号(可以修改,双击 具体的 server tomcat ),ssm是项目名)

1-在开发工具中使用tomcat

相关文章:

  • 2021-11-04
  • 2021-12-13
  • 2021-05-21
  • 2022-12-23
  • 2021-07-26
  • 2021-11-28
  • 2021-12-18
  • 2021-12-18
猜你喜欢
  • 2021-09-26
  • 2022-02-12
  • 2021-08-09
  • 2021-11-30
  • 2021-04-25
  • 2021-11-20
  • 2021-07-01
相关资源
相似解决方案