主要是tomcat服务器上的缓存引起的,只要在更新图片的时候同时给缓存更新即可
我项目存放图片的文件夹路径 C:\Users\miaoz\workspace\book\WebContent\images
然后再tomcat服务器上有个缓存空间C:\Users\miaoz\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\book\images
当刷新页面时图片还是从缓存空间中取,所以才会导致更新图片还是显示之前的,这里应该同时给两个路径的图片进行更新
例如在我的项目中
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); String bookinfo[] = {"","","","","","","",