IDE集成开发工具-IDEA-4.创建web工程&配置Tomcat

1、创建java-web工程,选择Jakarta EE,选择Web application,下一步创建即可

image

image

image

2Edit Configurations编辑配置

image

image

3、编辑配置需要选择tomcat,从tomcat官网下载tomcat Core包(全量包)

image

4、继续Edit Configurations编辑配置,增加Tomcat Server,配置ServerDeploymentApplication Context对应浏览器访问路径,这里配置后访问路径为http://localhost:8080/java_web_02/

image

image

这里选择了war,还可选择war exploded,开发环境一般用war exploded(和war相比,war exploded支持热部署,不用打包成war

image

5Debug运行,启动成功,但tomcat日志乱码

image

image

image

6apache-tomcat-11.0.10\conf\logging.propertiesjava.util.logging.ConsoleHandler.encoding等编码配置都由 UTF-8改成GBK,再起启动,日志显示正常

image

image

image

posted @ 2025-08-27 08:35  少年阿川  阅读(46)  评论(0)    收藏  举报