You can deploy an application directly from a development directory, if the appropriate directory hierarchy and deployment descriptors have been created. This directory must be accessible from the machine where Application Server is installed. Because the process is complex for non-trivial applications, it is a procedure that is recommended only for advanced users, or simple applications. But when it is feasible to do so, deploying directly from a directory can speed up the development cycle.
The process can be performed interactively by using the Admin Console, or by using asadmin deploydir from the command line or in a script. The steps for the command line are presented here, because most developers want to automate the procedure in command scripts.
Before using asadmin on Windows, see To Configure the Windows Environment to Use the Command-Line Tools.
In the install-dir/samples/quickstart/ directory, create a new directory called hello2/.
Unzip the contents of the hello.war file into the hello2/ directory.
Preserve the directory structure of the hello.war file when you unzip it. It is a template for the kind of file structure you need to deploy directly from a directory.
If you already have a Hello application deployed, undeploy it now using the command asadmin undeploy hello at the command line.
If you did not install the Application Server with the “Don’t prompt” option, also specify the option --user username, where username is the admin user name. You are prompted for the administration password.
Use the following command to deploy the application:
asadmin deploydir install-dir/samples/quickstart/hello2
Specify the full path to the hello2/ directory.
The following message appears: Command deploydir executed successfully.
Verify that the application is running by going to this URL: http://localhost:8080/hello.