Thursday, November 3, 2011

Oracle ADF How to get Managed Server name in Java


A little quicky here. If you want to know which managed server is your application currently running at you could use the similar code.

This code could be useful in cluster environment fail-over test. (I will cover in separate post)

1. Create a backing bean with request scope with following methods

    public String retrieveManagedServerName()
           String instance = System.getProperty("weblogic.Name");
           return instance;

       public String getManagedServer()
           return retrieveManagedServerName();

2. Use the method as value of af:output text

Have a nice day,
Zeeshan Baig

1 comment: