You might want to consider adding a javax.servlet.ServletContextListener to your web app that explicitly copies the required resources from the WAR (using javax.servlet.ServletContext#getResourceAsStream(java.lang.String) ) to a specific directory location and using that for your cgi scripts.
This will be less "hacky" and reasonably portable moving forwards.
What are those CGI scripts looking for in the tmp directory? Like Stephen says, a better way to do this is to have a specific non-tmp location where the scripts can find whatever they are looking for.
Stephen, Jaikiran: Many thanks for your proposals.
I agree that it would be less "hacky" to move all needed information in a non tmp-war location. Some of our needed resources are already outside the tmp location.
But we plan to replace those cgi scripts with servlets and web services. Therefore we don't want to make larger efforts in changing these old cgi files.
The renaming of the last part of the tmp directory structure would be a very simple solution for the meantime, but it seems that this is not configurable.