IBM Support

Setting webcontainer custom properties for WebSphere Application Server

Question & Answer


Question

How do I set a webcontainer custom property on IBM® WebSphere® Application Server?

Answer

To set a webcontainer custom property on IBM WebSphere Application Server Version 7 or Version 8:
  1. In the administrative console, click "Servers" and under Servers click "Server Types" and under Server Types click "WebSphere Application Servers"
  2. Click on the server to which the custom property is to be applied
  3. Under "Configuration" and "Container settings" click "Web Container Settings" and under Web Container Settings click "Web container"
  4. Under "Configuration" and "Additional Properties" click "Custom Properties"
  5. In the Custom Properties page, click "New"
  6. In the settings page, enter the name of the custom property to be added in the "Name" field and the value to be set for the custom property in the "Value" field. Note that some properties are case sensitive.
  7. Click "Apply" or "OK"
  8. Click "Save" in the "Messages" box that appears
  9. Restart the server for the custom property to take effect
 

To set a webcontainer custom property on IBM WebSphere Application Server Version 6:

  1. In the administrative console, click "Servers" and under Servers click "Application Servers"
  2. Click on the server to which the custom property is to be applied
  3. Under "Configuration" and "Container settings" click "Web Container Settings" and under Web Container Settings click "Web Container"
  4. Under "Configuration" and "Additional Properties" click "Custom Properties"
  5. In the Custom Properties page, click "New"
  6. In the settings page, enter the name of the custom property to be added in the "Name" field and the value to be set for the custom property in the "Value" field. Note that some properties are case sensitive.
  7. Click "Apply" or "OK"
  8. Click "Save" in the "Messages" box that appears
  9. Restart the server for the custom property to take effect


To set a webcontainer custom property on WebSphere Application Server Version 6 using wsadmin:
  1. Create a jacl script to add/update the custom property.
  2. Ensure that the server is running.
  3. Run the jacl script in wsadmin using "wsadmin -f <scriptName>.jacl
  4. Restart the server for the custom property to take effect.



An example jacl script which creates a webcontainer custom property, after deleting any current instances of the property being added, might contain the following but with lines 2 to 6 modified to specify appropriate values for <cell of server>, <node of server>, <server to create property for>,<webcontainer property name> and <webcontainer property value>:

# set variables
set cellName <cell of server>
set nodeName <node of server>
set serverName <server to create property for>
set propertyName <webcontainer property name>
set propertyValue <webcontainer property value>
# define some helper variables
set a1 [list name $propertyName]
set a2 [list value $propertyValue]
set attrs [list $a1 $a2]
# get server config
set server [$AdminConfig getid
/Cell:$cellName/Node:$nodeName/Server:$serverName/]
#get the webcontainer config from the server config
set webcontainer [$AdminConfig list WebContainer $server]
# get a list of existing webcontainer properties
set webcontainerProperties [$AdminConfig list Property $webcontainer]
# Check for existing properties with the same name and delete if found
if { ${webcontainerProperties} != "" } {
foreach propertyID ${webcontainerProperties} {
set propertyIDName [$AdminConfig showAttribute $propertyID name]
set match [string match $propertyIDName $propertyName]
if { ${match} == 1 } {
$AdminConfig remove $propertyID
}
}
}
# Create the specified property
$AdminConfig create Property $webcontainer $attrs
# Save updates
$AdminConfig save

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Component":"Servlet Engine\/Web Container","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.0;8.5;8.0;7.0;6.1;6.0.2;6.0","Edition":"Base;Enterprise;Express;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}},{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SS7K4U","label":"WebSphere Application Server for z\/OS"},"Component":"Servlet Engine\/Web Container","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"9.0;8.5;8.0;7.0;6.1;6.0.1;6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
20 November 2019

UID

swg21284395