cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from a properties file

Former Member
0 Kudos

As per the project requirement, we need to create a property file.

Can anyone please tell me,

1. where to create this property file in webdynpro application

2. how to read it from webdynpro application.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Angelo,

Thanks for your reply, please let me know what are the settings/chnages that need to be made on Visual administrator

waiting for your reply

Thanks

Hari Krishna

Former Member
0 Kudos

Thanks Poojith, I have one more query.

I have created a webdynpro project for reading the properties file. Now i am able to read the values form the file.

I have build the project and the EAR file got created.

When i extracted the EAR file, i could not locate the properties file i have created.

What my requirement is, i need to create a application level properties file in webdynpro project and when i deploy the EAR file in linux/unix box i should be able to read them.

Please advice, what should i do now

Former Member
0 Kudos

Hi Poojitha,

I have created a package com.ibm.resource under src/packages and my properties file name is Application.properties.

Correct me if i am wrong.

former_member214651
Active Contributor
0 Kudos

Hi,

This error comes if the resource is not under the package specified or if there is any mismatch in the name mentioned in the path.

Regards,

Poojith MV

Former Member
0 Kudos

Hi Satish,

When i tried out the example given in the document and trying to execute it, i am getting the following exception

java.util.MissingResourceException: Can't find bundle for base name com.ibm.resource.Application, locale en_US

former_member214651
Active Contributor
0 Kudos

Hi,

Give the path of the location where u have created the properties file in ur WD project. The message is from the tutorial:

ava.util.MissingResourceException: Can't find bundle for base name com.ibm.resource.Application, locale en_US

Regards,

Poojith MV

former_member185086
Active Contributor
0 Kudos

Hi

Follow the given tutorials it has all your requirement with code help

[Creating a Resource Bundle for the File Structure|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/47ce9b90-0201-0010-59b5-f70826824eee?quicklink=index&overridelayout=true]

BR

Satish Kumar

former_member192152
Active Participant
0 Kudos

>

> As per the project requirement, we need to create a property file.

>

> Can anyone please tell me,

>

> 1. where to create this property file in webdynpro application

> 2. how to read it from webdynpro application.

1. Save file in this path:


src/configuration/Components/yourComponentName

2. Use this source:


try
{
	final IWDConfiguration configuration = WDConfiguration.getConfigurationByName(wdComponentAPI.getDeployableObjectPart(), "filePropertiesName"); // Name of configuration file without ".properties"

	xyz = configuration.getStringEntry("parameter").trim();
}
catch (WDConfigurationNotFoundException e)
{
}
catch (WDInvalidConfigParameterException e)
{
}

regards,

Angelo

Edited by: Angelo Antonello Borges on Jun 8, 2010 4:05 PM

former_member192152
Active Participant
0 Kudos

>

> >

> > As per the project requirement, we need to create a property file.

> >

> > Can anyone please tell me,

> >

> > 1. where to create this property file in webdynpro application

> > 2. how to read it from webdynpro application.

>

> 1. Save file in this path:

>


> src/configuration/Components/yourComponentName
> 

>

> 2. Use this source:

>


> try
> {
> 	final IWDConfiguration configuration = WDConfiguration.getConfigurationByName(wdComponentAPI.getDeployableObjectPart(), "filePropertiesName"); // Name of configuration file without ".properties"
> 
> 	xyz = configuration.getStringEntry("parameter").trim();
> }
> catch (WDConfigurationNotFoundException e)
> {
> }
> catch (WDInvalidConfigParameterException e)
> {
> }
> 
> 

>

> regards,

> Angelo

>

> Edited by: Angelo Antonello Borges on Jun 8, 2010 4:05 PM

You must create this file properties in this way (configuration path of the application of component webdynpro).

> 1. Save file in this path:

>


> src/configuration/Components/yourComponentName
> 

That having been ok, and you can read this file via the Web Dynpro, your Basis team will also have access to these settings via Visual Administrator!

regards,

Angelo