Show TOC Start of Content Area

Background documentation Configuration Service  Locate the document in its SAP Library structure

Use

The configuration service can be used for accessing configuration files that are deployed with a Web Dynpro application. The configuration data is available in the form of name/value pairs in the properties files. The IWDConfiguration interface provides methods for accessing this configuration data as typed objects.

A Web Dynpro application can define its own configuration properties files This can be done at the level of a web module. The IWDConfiguration interface also provides methods to access the properties files that you have defined and to use the properties files to read data.

Note

You can define application-specific properties files yourself. To do this, you create a properties file that contains the corresponding name/value pairs using an editor of your choice. You then import this file into the corresponding directory structure in the Package Explorer:

If you want to use the properties file, you have to import the file into directory src/configurations in your Web Dynpro project.

When you deploy a Web Dynpro application that contains properties files, these property files are deployed as properties sheets in the Configuration Adapter of the Java Engine. To change these properties files, you can use the configuration adapter service of the configuration tool of the Java Engine. You then do not need to modify the source text or perform another deployment. You need to restart the server for any changes you have made to properties to take effect.

Note

Note that redeployment of the development component overwrites all the changes made to the properties files using the configuration adapter.

Example

The following source code describes how to access the data of configuration properties files:

try {

   IWDWebModule module =
    
wdComponentAPI.getDeployableObjectPart().getWebModule();

   IWDConfiguration config = WDConfiguration.getConfiguration(module);

   config.getIntEntry("key");

} catch (WDConfigurationNotFoundException e) {

   // TODO handle exception

} catch (WDInvalidConfigParameterException e) {

   // TODO handle exception

}

 

End of Content Area