[1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming There is documentation [1] on relation between context name, context path, context version and the base file name of a Context. There is one place where Tomcat 7 does not follow [1]: naming of javax.servlet.context.tempdir directory (aka work directory) for the application. It uses "_" for the default application. I propose to replace that with "ROOT", a) for consistency b) to avoid conflict if someone deploys web application named "_", e.g. in pursue of short URLs BTW, if someone is really facing such conflict, it could be remedied by specifying workDir attribute on a <Context>. (Though a bit hard to make the path unique without knowing the engine and host names).
Nice idea. Fixed in trunk for 8.0.0 onwards.
Regarding r1457454 , it is not enough. If I deploy ROOT##version, the workdir name will be "##version". For consistency I would expect "ROOT##version". Replacing String temp = getName(); with String temp = getBaseName(); should do the trick.
Done.