Dynamically creating web applications at deployment timeThere is no reason why web.xml and WAR files need to be created at build time, other than the belief that the WAR file format is a valid form for a redistributable Java Web application. If the files are created (somehow) immediately prior to deploying the application, the WAR application can be targeted at a specific installation. The main problem here is tooling: the target installation needs a product that can generate a web.xml file and WAR file on demand. Apache Ant can do this. SmartFrog can, although it is not something we have explicitly implemented. The sf-xml package can generate/edit and validate XML files, while Java's own jar command can be used to build a new WAR file, or patch an existing one. Some application installers -those that provide web applications for third parties- effectively follow this route, with the GUI asking the user questions that are then used to either tune a web.xml file, or generate other configuration files. Features
Advantages
Disadvantages
SmartFrog supportThis could be done via SmartFrog's Ant components, or by executing jar directly. The hard part is creating the web.xml file itself. Our sf-xml package provides some support to building a well-formed and valid XML document. |