GeeCON Prague 2014*
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
Author

Sharing a property file

Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

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.
Thanks
Pho
[ May 16, 2002: Message edited by: Pho Tek ]

Regards,

Pho
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
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.
Bill
 
GeeCON Prague 2014
 
subject: Sharing a property file