I am using JBoss4.0.1 and Struts2.1.6
I have an application which have some configuration file(appConfig.xml in folder WEB-INF/config). This congiuration file contains the relative paths of other files to be read.(other.xml, some.xml etc). Application is deployed as .war inside default/deploy
I have a Utility package that reads the configuration files. I have deployed the utility.jar inside default/lib
In contextInitialized method of ServletContextListener i am reading the appConfig.xml and passing IOStream on appConfig to my Utility Class, which reads this file and loads all the context relative paths.
how can i read these files now? becuase if i try to create an input stream it is returned NULL.
I have tried following inside Utility Class.
read method is called from inside the contextInitialized method of ServletContextListener
public void read(){
this.getClass().getClassLoader.getResourceAsStream("/WEB-INF/config/some.xml");
}
public void read(ClassLoader cl){
cl.getResourceAsStream("/WEB-INF/config/some.xml"); --> Null
cl.getResourceAsStream("/../config/some.xml"); --> Null
cl.getResourceAsStream("../config/some.xml"); --> Null
}
public void read(ServletContext ct){
ct.getResourceAsStream("/WEB-INF/config/some.xml");.
ct.getResourceAsStream("/../config/some.xml"); --> Null
ct.getResourceAsStream("../config/some.xml"); --> Null
}
any help will highly be obliged.