The problem is this, in the JSP Web page embedded in the local image, because it will be uploaded to the server image, so did not put in the project, but put all the pictures into a folder, and then plan to use the absolute path to display the picture displayed. For example, in the E-disk Uploadphotos folder. However, when the absolute path display is used. The code is as follows:
In Eclipse, the built-in browser can be displayed, but not to other browsers,
Later read this article
http://bbs.csdn.net/topics/320186157
Realize that the image on the server cannot be displayed on the client with an absolute path, as the absolute path is sent to the client browser. The absolute path of the client corresponds to the place and there is no picture. So to use the virtual path
Quote a passage to find
The virtual path is configured in Tomcat's Server.xml.
If your project is named news, the uploaded folder is D:/upload
Add a line to the Server.xml:
<context path= "/news/upload" docbase= "D:/upload"/>
You'll be able to use Http://localhost:8080/news/upload/xxx.doc to interview
This I tried many times, the principle is very clear no problem, but always do not work
After trying n times to check n times, I suddenly realized that my project was written under Eclipse and started Tomcat in Eclipse. Previous changes to Server.xml were made in the Tomcat folder, and the change was for the purpose of booting Tomcat through Startup.bat under the Tomcat Bin folder.
And I'm now the tomcat that started in eclipse. So the change didn't work, so I went to eclipse to try to find Tomcat's server.xml,
Sure enough, the Tomcat configuration file was found in the Workspace server folder. Then change the server.xml here to be able, assuming that the path I said did not find it. Just try to find somewhere else, anyway.
As for the server.xml changes in the same way as previously said, the assumption is not clear on the online tutorial, a search a large. Just make the change server.xml. Did not say clear changes in the Tomcat folder or in Eclipse.
jason0539
Weibo:http://weibo.com/2553717707
Blog:http://blog.csdn.net/jason0539(reprint please indicate the source)
JSP Web page does not display picture in browser _eclipse the virtual path of the JSP project in Tomcat under the environment