WAR files vs. Java apps with embedded servers

When should you deploy a Java app to the server as a traditional WAR file, and when should you use an embedded server in the application itself? [...]
When should you deploy a Java app to the server as a traditional WAR file, and when should you use an embedded server in the application itself? [...]
How to use free-form JavaScript code to add more power and flexibility to Ant builds, with no extra dependencies! [...]