on 02-22-2012 2:50 PM
Hello! fellows, i have a question regarding the properties of the J2EE engine.
Right now, i'm developing a servlet that needs to retrieve some properties from the J2EE engine. I already have the UME properties using the UME API; But what i need to retrieve now are the properties of the servlet_jsp and HTTP services properties (For example: properties: UseSecuritySessionIdUniqueName or SystemCookiesDataProtection )
Do you know how to retrieve those kind of properties in a programmatically way ?
Thanks in advance
Edited by: rpiseiro on Feb 22, 2012 3:50 PM
Edited by: rpiseiro on Feb 22, 2012 3:51 PM
import javax.naming.InitialContext;
import com.sap.engine.frame.core.configuration.Configuration;
import com.sap.engine.frame.core.configuration.ConfigurationContext;
import com.sap.engine.frame.core.configuration.ConfigurationHandler;
import com.sap.engine.frame.core.configuration.addons.PropertySheet;
import com.sap.engine.services.configuration.ConfigurationRuntimeInterface;
import com.sap.engine.services.configuration.appconfiguration.ApplicationConfigurationHandler;
........
InitialContext context = new InitialContext();
ConfigurationRuntimeInterface configInterface = (ConfigurationRuntimeInterface) context.lookup("configuration");
final ConfigurationContext configContext = configInterface.getConfigurationContext();
final ConfigurationHandler configHandler = configContext.getConfigurationHandler();
String configurationPath = "cluster_config/system/custom_global/cfg/services/http/properties";
final Configuration config = configHandler.openConfiguration(configurationPath, ApplicationConfigurationHandler.READ_ACCESS);
config.getConfigEntry("#~SystemCookiesDataProtection");
Classes are avalable in com.sap.engine.client.lib DC (sap.com_SAP-JEE)
Dont forget to add configuration service reference to your application-j2ee-engine.xml
<reference
reference-type="hard">
<reference-target
provider-name="sap.com"
target-type="service">configuration</reference-target>
</reference>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.