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 pictures displayed, For example, in the E-disk Uploadphotos folder, but when using absolute path display, 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 picture on the server cannot be displayed on the client with an absolute path, because the absolute path 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 post-upload directory is d:/upload
Add a line to the Server.xml:
<context path= "/news/upload" docbase= "D:/upload"/>
Later, you can use Http://localhost:8080/news/upload/xxx.doc to access the
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 that when I started Tomcat it was started in eclipse, and the previous change Server.xml was modified in Tomcat's directory, which was aimed at Tomcat In the bin directory, the role of Tomcat when booting through Startup.bat
I'm now a Tomcat launcher in eclipse, so the changes don't work, so I went to eclipse and tried to find Tomcat's server.xml,
Sure enough, in the workspace server directory to find the Tomcat configuration file, and then modify the server.xml here can be, if I say the path is not found, I try to find other places, anyway.
As for the server.xml of the way to modify the same as the previous said, if you do not understand the online tutorial, a search a large, but it is the same-made to modify the Server.xml, did not say clearly modify the Tomcat directory or eclipse.
jason0539
Weibo:http://weibo.com/2553717707
Blog:http://blog.csdn.net/jason0539(reprint please indicate the source)