Question

I have followed this blog: A programmer's blog. All upload images go to

Z:\glass_server_upload and I added a file named ImageView#img.xml in the tomcat C:\Program Files\Apache Software Foundation\Tomcat 7.0\conf\Catalina\localhost. And the file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="Z:/glass_server_upload" reloadable="true" crossContext="true" path="/ImageView/img" debug="9"></Context>

And now I want to display the images, so I enter the browser like this: localhost:8080/ImageView/img/pulpit.jpg. But the result is sadly 404.

Was it helpful?

Solution

According to the post the file should be

<Context docBase="Z:/glass_server_upload">
</Context>

What do you need to do:

  1. Locate $CATALINA_BASE/conf/Catalina/localhost
  2. Create a textfile there named ImageView#img.xml with the contents above
  3. Start/restart Tomcat
  4. Enter in the browser via http://localhost:8080/ImageView/img/yourimage.jpg
  5. if the file exists and you have permission to read the file, then it will be shown.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top