Hi everybody..
i need to access property file in my
servlet.
What i wanted to know was can we access a bean object for a key tthrough property file.
Say example if i have a bean
userBean having attributes as
String name
String address
Int phoneNmbr
well now i want to store all these infomation against an
USERID as key for these information in the property file.
the problem is how can i store all these values against USERID as key? because what i presume the value for key would be a single
String message. Not that i can get name , address,or telephone number separately for a same key.
What is going in my mind is that i can store like this in property file
2001 = Rohit,Street number 5 ABCD, 2828282;
and on fetching in servlet..i can break the String whereever i get comma. in this way i will get the required attributes for userBean and then i can create the key value pair for hashmap. but i don't know if this is a correct one method.
My Requirement in application
what i wanted in my application was that i would read the property file and fetch information against the USERID as key and create a hashmap where again the key is the USERID and value is userBean object which has the name , address, telephone number defined in the property file against the same USERID.
Is is it posssible in way..or some other way..
if in any way it can be implemented through property file , please suggest me the way.
i know i can store all these things in a database also ..but that is currently avoided and i want it to implement through property file.
Thanks.