Writing deployment descriptor
by, 05-25-2011 at 09:57 AM (2988 Views)
If you writing J2EE applications, you need to deploy your application to J2EE container like JBOSS. I will shed some light on how to write simple deployment descriptors for your web applications.
I am deploying my JSP application on JBOSS. For JBOSS, we need to put our application in WAR format in deploy folder. So deployment descriptor will have following 2 tasks:
- Archieve the application into WAR
- Copy that WAR to deploy folder of JBOSS
Assuming we are using default JBOSS configuration, following deployment descptor will serve our purpose:
Make sure you set JBOSS_HOME to your jboss directory. Simply save the deployment descriptor in a batch file (deploy.bat) and run it to preapre archieve and deploy on JBOSS.Java Code:"%JAVA_HOME%\bin\jar.exe" -cvf helloworld.war *.jsp WEB-INF copy helloworld.war "%JBossHome%\server\default\deploy"
I used the switch -cvf with JAR command.
- c for create new achieve
- v for generate verbose output on standard output
- f for specify archive file name
I hope this simple post will prove useful.