周末在家摆弄时,在一个原来新建时没有的web application的项目中,添加app Framework support。但在添加成功并且配置Tomcat之后,出现了404的问题。仔细一看,发现project structure项目结构中,webapp是和src在同一级目录下。

发现了问题所在后,打开了project structure中的artifacts,把默认的路径修改为现在webapp的路径,如图。

在进入project structure后,打开artifacts,然后在output directory中设置现有webapp的路径(我的webapp目录命名为web),解决了404问题。
网友评论