Intelli idea的web项目设置

如题所述

第1个回答  2022-07-15
创建web项目直接参考 https://blog.csdn.net/qq_38526573/article/details/89743221

再使用intelli idea编译web项目时,会遇到war中没有class,target或out下production 输出循环嵌套编译越来越慢,经排查跟项目目录设置有关系。

File-Project structure... 或 右击工程目录-选择Open Module Settings-打开Project structure设置弹框

->web Recource Directories 设置为web目录

-> 源码根目录设置为src

编译tomcat启动成功后,但是访问页面报404错误,发现是output directory路径配置错误了,项目输出路径应为tomcat的webapps路径下,如:/usr/local/apache-tomcat-8.5.8/webapps/ServletStudy_war_exploded。而不是项目路径,这个坑也有很多人踩,再此记录。