Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
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:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
How to load XML from classpath ?
Deepti Bhatia
Greenhorn
Posts: 25
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I have a requirement to load XML from the classpath. Could you please guide.
Deepti Bhatia
Greenhorn
Posts: 25
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Have tried with ClassLoader.getSystemResourceAsStream but the value returned is alwayz null.
Rob Spoor
Sheriff
Posts: 22781
131
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You're so very close -
you should
use getResourceAsStream, without the System part. Then it's just a matter of providing the right resource name.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions
How To Answer Questions
Not looking good. I think this might be the end. Wait! Is that a tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Struts2 basic doubts..
maven assembly and classpath issue
Using schema files in a jar
including ini file in project
Is it possible to move the beans.xml file outside my app?
More...