• 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

how to share web resources(html,jsp,classes in WEB-INF/classes) ascoss wars in a single ear

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,
I need multiple wars available inside a single ear to share the web resources like html,jsp and classes inside war.

My application has following structure

MyApp.ear
|
|--common.war
|
|--module1.war
|
|--module2.war
|
|ejb1.jar
|
|ejb2.jar



As my common.war has some common reusable jsp,jsf xhtml which are used by other module wars. I want those common reusable resources available in common.war to be accessible from other module wars inside same ear.

I don't want to copy those resurnce to each module as I have lot of files.

I thought I would be able to make it work by changing <property name="useJBossWebLoader">false</property> to true in jboss configuration file. I tried it in jboss 4 as well as jboss 5 "default" folder.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you are trying to do goes against the servlet spec - each WAR should live in isolation and outside classes should not have access to the contents of a WAR.

You already found the option that lets you share classes between WARs.

One way to solve this dilemma is to properly package your apps. For example, you can still maintain 3 source projects (common, module1 and module2) to promote code sharing and reuse. Then have your packaging script combine common+module1 and common+module2.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic