File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Sharing a property file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sharing a property file" Watch "Sharing a property file" New topic

Sharing a property file

Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 782

I gleaned a lot of information about property file construction from a previous posthere.
My question though is this:
I have two immutable objects A & B.
A is a heavyweight object which I'll
be using in my business logic. Whereas
B is a snapshot of relevant member variables
from A. B will be placed in the request scope
and subsequently used to paint a JSP page.
I want to create a property file which will
be accessible to both the JSP that uses B object
and also to A. How can I do that to minimize
number of reads ? I'm thinking that there should
another object representing the values read from
the property files and used by both.
[ May 16, 2002: Message edited by: Pho Tek ]


William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
Usually property files are text that can be read/saved with the java.util.Properties class.
It sounds like you could store your objects as serialized objects if you can make them serializable.
I agree. Here's the link:
subject: Sharing a property file
It's not a secret anymore!