Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML reading issues

 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,
I was trying to create custom resource bundle using XML file instead of routine property file loading as per following link
http://www.java2s.com/Code/Java/JDK-6/XMLresourcebundle.htm
I did everything as given in the link. But I was not able to execute the program when I run it. The java program supposed to read the Strings.XML data and similar other XML files based on the arguments we pass in newBundle method. Please advise.
Any links, resources, suggestions, sample code highly appreciated. Thanks in advance.
 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have couple of classes


other class looks like



xml is at location
C:/xyz/abc

Please advise
 
Pradeep Katipamula
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I didn't change your code much (only removed few lines). Below is the code


The Resources bundle reads the files through the classloader. So here i copied the xml properties file 'myresources' to the packges structure 'com.test' and updated the same in the above code, which solves the problem.

I hope this helps

If you have any other requirements just let me know.

Pradeep
 
Pradeep Katipamula
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And i am not sure why you have posted this under 'JSF'
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic