• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading values from properties file using ResourceBundle and then insert a method  RSS feed

 
dbala subramaniam
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ALL
My Requirment is

I am reading all report parameters from my properties file,
say WMTConfig.properties, then all the values I am reading using ResourceBundle via WMTConfig.java, then all the values I am setting in
2 HashMaps in WMTConfig.java, but I need to pass the HashMaps to main Java Programs and other programs for that I need put a method inside a
once called it will return HashMap which inside the WMTConfig.java sothat this method can be invoked from any job programs and get the HashMap , but inside WMTCOnfig is not accepting any methods except only one constructor, so how to resolve the problem,
I don't have any other file which read the values from properties file,
only file which will read property file called WMTConfig.properties is
WMTConfig which accepts no methods and only one constructor
Error
Malformed Expression-try{
config = ResourceBundle.getBundle("WMTConfig", Locale.ENGLISH);
}
illegal Start of Expression-before method name declaration
public HashMap ReportParameters(){ which inside a WMTCOnfig.java
please clarify,suggest
clarify
with regards
bala
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure at all that I understand the question, but a couple of points.
First, it looks like it is just complaining about a syntax error. Can you show us more of the code and exactly what you are passing in?
Next, why are you doing it THIS way? Can you try to explain what you are trying to accomplish so that we can suggest a different way to get the same thing done.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!