• 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

read xml from JAR file

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

I want to build a webproject that includes a "core"-application. This core is in a JAR file. It uses it's own struts configuration.

I tried to reference from the web.xml in the main-project to the struts-config.xml located inside the core-jar file
like this:



As this idea did not work I've put the core config file under web-inf in the main project.
Now the config file is found by the application and properties-files defined inside it (like ApplicationResources.properties [messages]) are also found, but the xml files referenced in the struts-config (like validator-config.xml or tiles-config.xml) cannot be found.

Example:

This works:


This didn't work:



Why can properties be found inside a jar file but no xml files ? Is there a way to do this ?

DO1EH
 
Ranch Hand
Posts: 122
Mac IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I usually have no issues when I use XXXX.class.getClassLoader().getResourceAsStream(filename) ... I usually read some XML for configuration that may not be in a properties file.
 
Ralf Heinecke
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[quote=Lucas Mireles]I usually have no issues when I use XXXX.class.getClassLoader().getResourceAsStream(filename) ... I usually read some XML for configuration that may not be in a properties file.[/quote]

Yes it's no problem to read other xml files (like the hbm.xmls from hibernate) only the struts-config has a problem and i ask myself why.
 
They weren't very bright, but they were very, very big. Ad contrast:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic