In IBM WebSphere web admin console one can go to Applications -> WebSphere enterprise applications, pick an application and click on "Custom Properties" link. There will be a page to add key-value pairs. How would you access those values from the code? The properties don't seem to end up in System properties nor in ServletContext..
-
2Interesting. I see this in WAS 8, but not in WAS 6.1. In WAS 6.1, I only see Custom Properties under Application Server > JVM, and those properties there do become System properties (we use them). – dbreaux Jan 10 '13 at 15:53
-
There're many places where Custom Properties appear, e.g. JVM, Web Container, WebSphere MQ, Policy set bindings and many more, but this particular question asked about application's and I don't think they're a means to convey information from WebSphere (the runtime environment) to an enterprise application. There're better ways as I described in the answer below. – Jacek Laskowski Jan 10 '13 at 17:20
-
3I'm late to the party ... but in case anybody else sees this, 1) WebSphere custom properties are indeed Good and Useful, 2) dbreaux is correct - you read them in Java as an ordinary System property: `String propVal = System.getProperty("my.custom.property");` – FoggyDay Aug 27 '14 at 01:17
-
WAS 9 Does Not show up in System.getProperty() when you add from Enterprise Applications as indicated by OP. – escape-llc Sep 30 '19 at 15:39
4 Answers
I tested this on WAS ND 8.5. Adding a custom property to the application adds it to the deployment.xml.
I updated \DefaultApplication.ear with the property name="testprop" value="true". It gets updated here:
C:\WASNEW85\WebSphere\AppServer\profiles\Dmgr01\config\cells\cell01\applications\DefaultApplication.ear.ear\deployments\DefaultApplication.ear
The value shows:
<properties xmi:id="Property_1424805152486" name="testprop" value="true" description="test-forum" required="false"/>
I hope this helps.

- 4,062
- 5
- 28
- 44

- 69
- 2
This answer will be not exactly on the topic, but it can resolve the issue to define and set configuration properties for Web Applications managed by WebSphere.
The easiest way to define configuration settings for a Web Application under WebSphere is below:
- Define a Web Application settings using the
servlet
initialization parameters:
web.xml
<servlet>
<servlet-name>my-servlet</servlet-name>
<servlet-class>
my.servlet.ClassName
</servlet-class>
<init-param>
<param-name>someConfigurationPropertyName</param-name>
<param-value>This Value Can Be Set</param-value>
</init-param>
</servlet>
- The value of these
servlet
parameters can be changed using Web Administration Console, you will find and can change them inEnterprise Applications > your-web-application-name > Initialize parameters for servlets

- 1,746
- 1
- 12
- 29
I've never seen it used during my 7-year career with IBM WebSphere Application Server. I think that if it's ever used it's so rarely that I'd call the feature a left-over from the past version of IBM WebSphere that supported it.
For application-specific configuration settings I'd strongly recommend web.xml
for web applications or @Resource annotation for web applications and the other application types.

- 72,696
- 27
- 242
- 420
-
Just checking my WAS 6.1 and 8.0 servers, I see this in 8.0 but not in 6.1. – dbreaux Jan 10 '13 at 15:54
-
I've also never seen it in my 8-year career with IBM WebSphere :) And I think it's something brand new. If this is what I think it is (system props on app level) that would be very handy. But it doesn't work.. so may be it's not what i think it is, may be it only allows some specific defined by IBM properties to configure how the app runs and not to let you define system properties. May be someone knows for sure? – Maxim Suponya Jan 14 '13 at 07:02
To set a webcontainer custom property on IBM WebSphere Application Server Version 7 or Version 8
- In the administrative console, click "Servers" and under Servers click "Server Types" and under Server Types click "WebSphere Application Servers"
- Click on the server to which the custom property is to be applied
- Under "Configuration" and "Container settings" click "Web Container Settings" and under Web Container Settings click "Web container"
- Under "Configuration" and "Additional Properties" click "Custom Properties"
- In the Custom Properties page, click "New"
- 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.
- Click "Apply" or "OK"
- Click "Save" in the "Messages" box that appears
- Restart the server for the custom property to take effect
To set a webcontainer custom property on IBM WebSphere Application Server Version 6:
- In the administrative console, click "Servers" and under Servers click "Application Servers"
- Click on the server to which the custom property is to be applied
- Under "Configuration" and "Container settings" click "Web Container Settings" and under Web Container Settings click "Web Container"
- Under "Configuration" and "Additional Properties" click "Custom Properties"
- In the Custom Properties page, click "New"
- 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.
- Click "Apply" or "OK"
- Click "Save" in the "Messages" box that appears
- Restart the server for the custom property to take effect
To set a webcontainer custom property on WebSphere Application Server Version 6 using wsadmin:
- Create a jacl script to add/update the custom property.
- Ensure that the server is running.
- Run the jacl script in wsadmin using "wsadmin -f .jacl
- Restart the server for the custom property to take effect.

- 95
- 2
- 11
-
1How does this answer the question, i.e. accessing custom properties programmatically? – ᄂ ᄀ Sep 16 '17 at 11:31