• 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

Regarding reading a xml file in a war file

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have a war in which i have a xml directory as follows :

APP/WEB-INF
APP/xml/abc.xml

I want to read the xml file in the model classes as they contain configuration parameters.
The war is not exploded in Weblogic 7.0.
How do i read the XML file.
I tried using the class Loader.But it does not work.
I can very well get the xml file using the following code :
java.net.URL url = config.getServletContext().getResource("/xml/eventRules.xml");

String filepath=url.toString();
out.println("File Path"+filepath);
But this would mean I will have to pass the parameter always to the model classes.
Any way to achieve this.
also
1) Can you explode a war in Weblogic
2) Is there any system property which i can use to get the Application context path in Weblogic 7.0
Thanks & Regards,
Nitin
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic