You can deploy applications from the command line using the asadmin deploy command.
The sample application must be available before you start this task. To download the sample, see Obtaining a Sample Application. At least one GlassFish Server domain must be started before you deploy the sample application.
Use the asadmin deploy command.
The general form for the command is:
as-install/bin/asadmin deploy war-name |
To deploy the hello.war sample, the command is:
as-install/bin/asadmin deploy sample-dir/hello.war |
Access the hello application by typing the following URL in your browser:
http://localhost:8080/hello |
The application's start page is displayed, and you are prompted to type your name.
Hi, my name is Duke. What's yours? |
Type your name and click Submit.
The application displays a customized response, giving you a personal Hello.
See deploy(1) for more information about the deploy command.
See the Oracle GlassFish Server 3.0.1 Application Deployment Guide for more information about deploying applications from the command line.
Use the asadmin undeploy command.
The general form for the command is:
as-install/bin/asadmin undeploy war-name |
For war-name, use the literal hello, not the full hello.war name.
For the hello.war example, the command is:
as-install/bin/asadmin undeploy hello |
See undeploy(1) for more information about the undeploy command.