jsp页面显示 本地图片,server.xml配置 虚拟路径

 CutPic.jsp

<body>
    <img src="http://localhost:8081/virtualCutPicUrl/oneCutPic.jpg" alt="图片预览2" > <br>
  </body>

<!-- 备注
1.tomcat 下server.xml文件中需要配置

<HOST>

    <!--增加的下面这行中path="/虚拟名" docBase="虚拟路径,为本地物理路径" -->
    <Context path="/virtualCutPicUrl" docBase="D:\ffmpeg_mencoder_File\cutPicture\" reloadable="true"></Context>

</HOST>

2.CutPic.jsp文件中,格式为
<img src='http://ip+端口/虚拟路径/文件夹/文件名'>  
-->

猜你喜欢

转载自blog.csdn.net/LaOngDaoxing/article/details/82223237