- 1.在tomcat服务器:目录里有 **conf/server.xml 文件
server.xml 文件:里面有:下面代码:(我摘抄一些代码)
其中:
Host name=“localhost” appbase=“webapps”,是用localhost 代替了webapps
(真实路径)
所以我们:使用
http://localhost:8080/demo3_war_exploded/demo1
相对于:
D:java webapache-tomcat-8.5.72webappsdemo3_war
这个真实路径
访问的是:自己目录下的:webapps目录下的demo3_war里面的
文件(可能是index.jsp,html文件.等等)
当你修改:
Host name=“localhost” appbase=“webapps”
修改为:
Host name=“wertyu” appbase=“webapps”
访问就要写:网址
http://wertyu:8080/demo3_war_exploded/demo1**
对比:只换了:localhost
http://localhost:8080/demo3_war_exploded/demo1



