图片服务器搭建(Tomcat)

转:https://blog.csdn.net/yhzs18351956660/article/details/84198259

1.在tomcat安装目录下创建文件夹fileService
并在fileService文件夹下创建文件夹images
(在images文件夹下创建图片文件1.jpg)

注:我的Tomcat服务器采用apache-tomcat-7.0.78压缩版,并安装在E盘。

2.修改tomcat安装目录conf下的server.xml文件
在host节点下增加节点
<Context docBase="E:\apache-tomcat-7.0.78\fileService" path="/system/fileService" />

3.修改tomcat安装目录conf下的web.xml文件
servlet(default)节点下的listings的value改为true

4.打开bin文件夹下的startup.bat文件重新启动Tomcat,并在浏览器输入地址:http://localhost:8080/system/fileService/images/1.jpg可以正常访问图片



猜你喜欢

转载自www.cnblogs.com/a155-/p/12749345.html