I have an EAR with a WAR and a lot of EJB-modules inside.
Each EJB-module has a file called "menu.js" (a JSON array) . I use that files to create an automatic menu configuration reading that JSON.
If I include the EJB-module in a new EAR, i bring the menus with it.
For example, a GeoDataModule has a menu entry called Country. In each EAR project where I want to use that module, I want to create all the menu entries required.
Actually I put these json object in a resource archive and I read it from the war.
What I want to do is to cicle throw all the EJB-modules and read the "menu.js" file. This procedure must be done in a class inside the war and the war is the same for all projects (the WAR has only some common ruotines, nothing specific for the EAR). So, the WAR don't know what are the ejb-modules included in the EAR.
How can I achieve that procedure? I need something like:
list all the ejb-modules included in the ear;
for each ejb module, read the menu.js file
ClassLoader
, but you can try something like:getClass().getClassLoader().findResources("menu.js")
– Maurice Perry@Startup
EJB in each module and@Observes
it from the web module. It's not something I've ever tried though. – Steve C