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.

Application-Specific Settings

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.

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 import the file into directory src/configurations in your Web Dynpro project.

When you deploy a Web Dynpro application that contains new properties files, these files are deployed as properties sheets in the Configuration Adapterof the Java Engine. To change them, 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.

To summarize: During deployment, the attributes of a property sheet are used as default values. You can customize these values using SAP NetWeaver Administrator. Configuration data (default + custom) is always kept until you trigger an explicit undeployment.

 

Note

Server restarts:

You need to restart the server for any changes you have made to properties to take effect if you use the local configuration tool started via config.bat. If you use the SAP NetWeaver Administrator tool, a restart is not necessary.

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