Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multilevel context path for ROOT app does not work  RSS feed

anton moiseev
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I want to make external dir outside tomcat webapps to be available from web.

To do this, I use the common way - create context file "apache-tomcat/conf/Catalina/localhost/testapp#images.xml" with contents:

So filesystem file "/files/images/img1.png" can be accessed from web as "http://localhost:8080/testapp/images/img1.png"

Until now this works ok. Now I want to make same trick for the ROOT webapp. As it is said here: , ROOT application context can be defined as "apache-tomcat/conf/Catalina/localhost/ROOT.xml".

So, I just renamed "apache-tomcat/conf/Catalina/localhost/testapp#images.xml" to "apache-tomcat/conf/Catalina/localhost/ROOT#images.xml" and was expecting that I can now access the files from web with "http://localhost:8080/images/img1.png" in the same way as it worked for "testapp", but this did not work this time - tomcat returns resource not found page.

I have apache-tomcat-7.0.5 running on linux.

Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!