• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

XML reading issues

 
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have couple of classes


other class looks like



xml is at location
C:/xyz/abc

Please advise
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And i am not sure why you have posted this under 'JSF'
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic