on 02-26-2010 5:23 AM
Hi,
If I use properties file colors.properties in my web dynpro application for storing key-value pairs as
color1=RED
color2=BLUE
color3=GREEN
is it possible to change colors.properties in future to show new colors
color1=ORANGE
color2=YELLOW
color3=PURPLE
without redeploying code ? through Visual Admin / Config tool ?
If not, what is the other way to avoid hard coded values in Web Dynpro Java ?
Thanks !!
Hi asif
Yes it's possible with WebDynpro configuration API. See the javadocs here: [Package com.sap.tc.webdynpro.services.sal.config.api|http://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/services/sal/config/api/package-summary.html]
If you put your property file inside WebDynpro component it'll be deployed to J2EE Configuration Adapter repository. Later on you can edit the properties in Config Tool. However, restart of the WebDynpro application is required after you modified the properties in Config Tool.
BR, Siarhei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Asif
Check the docu: [Configuration Service|http://help.sap.com/saphelp_nw70/helpdata/en/b8/aa343e32ff1033e10000000a114084/content.htm]
1. Put property file in _comp\src\configuration\default.properties
2. Read the properties with help of the API I posted before.
3. Modify the properties in ConfigTool->appcfg-><app_name>->propertysheet
It's possible to use named property files instead of default.properties. You have to put the colors.properties under the Webdynpro component in \_comp\src\configuration\Components\<comp name>\colors.properties. In the case a path in ConfigTool's tree will be a little bit deeper then for default.properties.
BR, Siarhei
Hi,
Its can be achieved using the WDConfiguration API of Java Webdynpro.
The details are given in the blog below;
/people/daniel.wirbser/blog/2005/09/28/properties-files-in-web-dynpro-applications-how-to-use-the-wdconfiguration-api
Also for changing this properties all we need to do is from Visual Administrator/Config tool(changing from config tool will need a re-start)
Proceed as follows to start the Visual Administrator:
1. Start the Visual Administrator by double-clicking on file go.bat in the file directory C:\usr\sap\<System ID>\<System Number>\j2ee\admin, in which the J2EE Engine is installed. For example, the background file can be stored in directory C:\usr\sap\J2E\JC00\j2ee\admin.
You can find a description of the Visual Administrator in the SAP Library under SAP NetWeaver u00AE Application Platform (SAP Web Application Server) u00AE J2EE Technology in the SAPWeb Application Server u00AE Administration Guide u00AE Server Administration u00AE SAP J2EE Engine Administration Tools u00AE Visual Administrator.
2. Navigate to directory Server 0/Services/ Configuration Adapter / webdynpro/ <sap.com/Your namespace>/ <Your Web dynpro application>
3. Select the property file
4. The Visual Administrator opens so that you can edit the values. You can change or redefine the parameters and check the option "Use Custom " to take the new value.
Thats all.
One more URL is
http://help.sap.com/saphelp_nw04/helpdata/en/09/a4d6a674bc1d4a9e74abf81bed3ef6/frameset.htm
Regards
Priya
Dear Asif,
You could create a custom database table in R3 for for stroring the key/description, thenusing RFC you can import the data to your WDJ application.
Hope it helps!
Upendra Agrawal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Asif,
If you use store colors.properties file in the Knowledge managenent (KM) and use this file in web dynpro for Java...then you can modify colors.properties file without modifying/deploying web dynpro for Java code
Hope this will help you.
thanks
Arun Jaiswal
Edited by: Arun Jaiswal on Feb 26, 2010 2:29 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.