This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Alter root of web.xml  RSS feed

 
Doug Thomas
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need a generic (acceptable to all web servers) method of setting the root directory "/" to be webapps/myApp in web.xml? I have defined an <err-file> element in my web.xml file with a <location>err404.html</location> subelement. I want the err404.html file to reside in "webapp/myApp" folder. If I use "err404.html", it looks in the bin directory (Tomcat5.0). If I use /err404.html, it looks in C:/. I can't use a complete physical pathname, because the app may be installed on any server and the file system structure is unknown in advance.

Any ideas?
Doug
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot set the doc root of the web app in web.xml. That must be performed in the config file for whatever container you are using (server.xml for Tomcat, for example).
 
Doug Thomas
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bummer! Thanks for the quick reply.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!