Hi,

I'm looking for some advice as to the best way to deploy XML files with EARs.

In the past, I have deployed XML files in the WEB-INF directory of Web 
applications. This allows me to read the XML from servlets by using the 
servletContext.getRealPath() method to determine the path to the document root.

This works OK for servlets but it doesn't work for EJBs, since an EJB has no 
servletContext. When I need an EJB method to read an XML file I've been 
resorting to passing it the real path as a parameter, but this is getting 
tedious.

I've considered using ejb-jar.xml to specify the path of the XML file as a 
env-entry, but I deploy my application on several different machines with 
different directory structures, so this would be difficult to manage.

I'm sure there are better ways to solve this problem - any recommendations? Is 
there a way an EJB can get the path to the root of the EAR deployment?

Thanks.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981388#3981388

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981388
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to