1.在conf/server.xml的标签中添加
<Context docBase="G:\Temp" path="/img" reloadable="true" crossContext="true" />
然后在浏览器中就可以通过localhost:8080/img/001.png访问到图片了。
2.在IDEA中配置



然后就可以通过localhost:8080:/ceshi/001.png访问到图片了。
博客介绍了通过两种方式实现图片访问。一是在conf/server.xml标签中添加配置,可通过localhost:8080/img/001.png访问图片;二是在IDEA中进行配置,能通过localhost:8080:/ceshi/001.png访问图片。
1.在conf/server.xml的标签中添加
<Context docBase="G:\Temp" path="/img" reloadable="true" crossContext="true" />
然后在浏览器中就可以通过localhost:8080/img/001.png访问到图片了。
2.在IDEA中配置



然后就可以通过localhost:8080:/ceshi/001.png访问到图片了。
1606

被折叠的 条评论
为什么被折叠?