10

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

http://localhost:8080/myFolder/myFile.f

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?

Sae1962
  • 111
Ankur
  • 2,389

2 Answers2

12

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

/webapps/ROOT/myFolder/
G__
  • 324
7

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

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

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

Sae1962
  • 111