This example demonstrates how to deploy a simple web application.
The application is composed of a very simple JSP page, which greets the user and prints the time, the hostname of the container that served the request and some additional details.
The example uses maven as its build tool. It comes with a build script that runs maven automatically. Running the build script with no parameters within the current directory will list all the relevant tasks that can be run with this example.
The available commands are:
Running 'build.(sh/bat) package' will finalize the processing unit structure under /examples/web-app/web-plain/target/PlainWebAppExample/
and create a deployment WAR /examples/web-app/web-plain/target/PlainWebAppExample.war
.
/examples/web-app/web-plain/target/PlainWebAppExample/
contains the hello.jsp
/examples/web-app/web-plain/target/PlainWebAppExample/META-INF/spring/
contains pu.properties
for the server configuration and sla.xml
contains the deployment properties (number of instances and constraints)
/examples/web-app/web-plain/target/PlainWebAppExample/WEB-INF/
contains the web.xml
referencing the hello.jsp
In order to deploy the web example onto the Service Grid:
run XAP agent from $XAP_HOME/bin/gs-agent(.sh/bat)
which will start a GSM and 2 GSCs.
run build.(sh/bat) deploy
. The will deploy the /examples/web-app/web-plain/target/PlainWebAppExample.war
into the running GSM.
The web page of this application is available at http://<host IP>:<web port>/PlainWebAppExample/
for example (http://localhost:8081/PlainWebAppExample/)
For more information, lookup 'First Web Application' under http://docs.gigaspaces.com