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:
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.