If you're using Tomcat, you have to create a new and complete foo.war file, delete the previous foo directory, and restart Tomcat for your changes to take effect:
Copy the web application archive file into directory $CATALINA_HOME/webapps/. When Tomcat is started, it will automatically expand the web application archive file into its unpacked form, and execute the application that way. NOTE - If you use this approach, and wish to update your application later, you must both replace the web application archive file AND delete the expanded directory that Tomcat created, and then restart Tomcat, in order to reflect your changes.
There are probably other deployment options that allow you to deploy only patches (and not have to restart Tomcat). You'll have to try them out and see what happens.