IBM Support

Setting webcontainer custom properties for WebSphere Application Server

Technote (FAQ)


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


Cross reference information
Segment Product Component Platform Version Edition
Application Servers WebSphere Application Server for z/OS Servlet Engine/Web Container z/OS, OS/390 8.0, 7.0, 6.1, 6.0.1, 6.0

Document information

More support for: WebSphere Application Server
Servlet Engine/Web Container

Software version: 6.0, 6.0.2, 6.1, 7.0, 8.0

Operating system(s): AIX, HP-UX, IBM i, Linux, Solaris, Windows

Software edition: Base, Enterprise, Express, Network Deployment

Reference #: 1284395

Modified date: 03 October 2008