cancel
Showing results for 
Search instead for 
Did you mean: 

Properties-File in a Servlet-Context

Former Member
0 Kudos

Hello,

How can I use a .properties-file within a servlet context, where do I have to store it ?

I am working with SAP Web AS 6.40, 90-days-trial-version.

Thank you very much in advance.

Bye.

Nadine

Accepted Solutions (1)

Accepted Solutions (1)

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

You better don't.

For this purpose there are descriptors in web.xml. If you try to use property files and install this on a propduction site of WebAS you soon will have trouble:

Wrtiing to this file means your servlet only will write to the local file. Your next login may transport you to a different server, where this properties file may look completely different...

If you want to write properties, you should write to a table in the DB.

Regards,

Benny

Former Member
0 Kudos

Hi Benny,

Thank you for your help.

The .properties file that I want to use it the file that contains the information neede to access the DB.

Kind regards,

Nadine

Former Member
0 Kudos

Hi Nadine,

this is normally done via a Resource Reference to a java.sql.DataSource. Please have at look at the corresponding <a href="http://help.sap.com/saphelp_nw04/helpdata/en/15/6d56f65fb59e4db97253c89c5cfefd/frameset.htm">chapter</a> in the NW '04 documentation.

The properties of the DataSource can be edited using the Visual Admin at "Server Node->Services->JDBC Connector"

Hope that helps.

Kind regards

Stefan

Former Member
0 Kudos

Hello Stefan,

I will try it like this.

Thank you very much.

Kind regards,

Nadine

former_member374
Active Contributor
0 Kudos

Hi Nadine,

You are thanking a poster for his answer.

Please next time also give him points.

See: /people/mark.finnern/blog/2004/08/10/spread-the-love

This time I did it for you.

Remember: When you ask a question you also assume the responsibility to assign points.

Please check your other questions and if the answers were good.

Spread the love and give some points.

Thanks in advance, Mark.

Answers (1)

Answers (1)

maniksaha
Explorer
0 Kudos

Hi,

I have a similar situation where I need to place some info in a .properties file in an EJB jar. Where should this file be placed (context?) and how can I access it?

The file is read only, it is there to provide flexibility to the application.

Thanks in advance,

Manik