This example demonstrates how to deploy a web application with an HTTP session.
The UpdateSessionServlet is responsible for retrieving request parameters and adding their values to the HttpSession as session attributes, and the SessionContents.jsp displays the session attributes and renders two input fields, Name and Value for the user to input new session attributes.
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-session/target/HttpSession/ and create a deployment WAR /examples/web-app/web-session/target/HttpSession.war.
/examples/web-app/web-session/target/HttpSession/ contains the SessionContents.jsp
/examples/web-app/web-session/target/HttpSession/META-INF/spring/ contains pu.properties and pu.xml for the session configuration and sla.xml contains the deployment properties (number of instances and constraints)
/examples/web-app/web-session/target/HttpSession/WEB-INF/ contains the web.xml referencing the servlet class
In order to deploy the web example onto the Service Grid:
run XAP agent with manager $XAP_HOME/bin/xap host run-agent --auto --gsc=3 which will start a Manager, 3 GSCs and GS-WEBUI
run build.(sh/bat) deploy. This will deploy the /examples/web-app/web-session/target/HttpSession.war into the running GSM.
The web page of this application is available at http://<host IP>:<web port>/HttpSession/ for example (http://localhost:8180/HttpSession/, http://localhost:8181/HttpSession/ and http://localhost:8182/HttpSession/)