Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to be able to access a folder from my tomcat webapps folder so that I can give someone a URL like:


And in a web browser if they point to this they should start downloading the file.

But in reality I get a 404 error when I try to point to this location.

How can I solve this or get around it.

share|improve this question
up vote 2 down vote accepted

You can also place the folder inside the default servlet. For your example, the folder would be:

share|improve this answer

Make your folder a web application: put a WEB-INF folder with a minimal web.xml file into your folder, the web.xml file could look like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "">

Then configure Tomcat to deploy the webapp with the URI you want.

share|improve this answer
OK this worked for me. Basically "have a WEB-INFO/web.xml file" then within tomcat, something like mkdir webapps/<your web app name>/myFolder then touch something there. It should become available on "your_hostname:8080/<your web app name>/myFolder/MyFile.f" – rogerdpack Mar 11 '15 at 14:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.