Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

XML reading issues

 
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
 
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'
 
What's brown and sticky? ... a stick. Or a tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic