修改server.xml配置文件 增加代码 <Context path="" docBase="./"></Context> 把txt文件放入webapps目录下。 最后通过域名+“/”+文件名,就可以直接打开txt文件了。