Install a web application

Along with Grid applications, Grid also supports web applications (war files). Once installed the web application works just like a Grid application.

To install a web application:

  1. On the Application page, select Install New to open the Install Application dialog box.
  2. Select the Upload link in the Install Application dialog box to open the Upload to Repository dialog box.
  3. Click the Browse button and select a Web Application Archive file (.war).
  4. The Install Application dialog box now shows the selected .war file along with two new fields, Type Name and Version.
  5. Specify a Type Name. This is the application name for the entry in the Application Repository.
  6. Specify a Version. This is the application version for the entry in the Application Repository.
  7. Optionally click the Show Details link for selection of advanced features.
    Vertically Scalable

    Determines whether the application can be scaled vertically on the same host; enabled by default.

    Horizontally Scalable

    Determines whether the application can be scaled horizontally across multiple hosts; enabled by default.

    Session Affinity

    Indicates that the application requires Session Affinity; enabled by default.

    Parent Class Loader First

    Determines the behavior of the web application classloader; disabled by default.

  8. Click the Upload button to add the Web Application to the Application Repository.
  9. Select the newly uploaded application in the Install Application dialog box and click Next.
  10. Specify a name for the application.
  11. Select the Auto Scaling option if the application must be automatically installed on any new hosts added to the Grid.
  12. Select what hosts the application must initially be installed on.
  13. Click Install to complete the installation.

By default a global Binding, named as the application, with minimum set one is created. Also a context root with the same name as the binding in lower case is added.

Servlet Context Init Parameters

Servlets may require configuration in the form of Servlet Context Init Parameters. Such parameters can be added to the application in the form of Grid Properties.

To add a Grid Property which will be used as a Servlet Context Init Parameter:

  • On the Applications page, select the Web Application to expand the details for the application.

  • From the details, select Properties to go to the property configuration page.

  • Select Add Ad Hoc Property at the bottom of the page to display the fields for creating an ad hoc property.

  • Specify the name of the property. In order for the property to be propagated to the Servlet Context as an Init Parameter, the property must be prefixed with "grid.servletContext.initParam.". For example: "grid.servletContext.initParam.Language".

  • Leave all check boxes unselected.

  • Click Add to create the property and display the edit property page.

  • Click Edit to set the value for all hosts. If the value should only be valid for a specific host, select a host in the context listing on the left.

  • Specify a value and click Save.

  • At this point the application must be restarted in order for the properties to be propagated to the Servlet Context.

Deployment profile data

Servlet Context Init Parameter Grid properties can be created during installation through the use of a Profile Data file. The profile data file for Web Applications uses the same format as the normal Grid applications (Java properties). During installation the profile data file is read and for each key prefixed with "servletContext" a grid.servletContext.initpParam Grid property is created.

Example:

A profile data properties file has these contents:

servletContext.language=EN
servletContext.database=dbserver.example.com

Two grid properties are created:

grid.servletContext.initParam.language=EN
grid.servletContext.initParam.database=dbserver.example.com

These properties in turn are available as Init Parameters named "language" and "database" in the Servlet Context when the application starts.