How does Tomcat locate the webapps directory?

前端 未结 4 1556
北恋
北恋 2020-11-30 03:33

How does Tomcat locate webapps directory? Where is this location set? Is it a relative directory?

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-30 04:29

    I'm using Tomcat through XAMPP which might have been the cause of this problem. When I changed appBase="C:/Java Project/", for example, I kept getting "This localhost page can't be found" in the browser.

    I had to add a folder called ROOT inside the Java Project folder and then it worked. Any files you're working on have to be inside this ROOT folder but you need to leave appBase="C:/Java Project/" as changing it to appBase="C:/Java Project/ROOT" will cause "This localhost page can't be found" to be displayed again.

    Maybe needing the ROOT folder is obvious to more experienced Java developers but it wasn't for me so hopefully this helps anyone else encountering the same problem.

提交回复
热议问题