aspose file tools*
The moose likes JBoss/WildFly and the fly likes how to share web resources(html,jsp,classes in WEB-INF/classes) ascoss wars in a single ear Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "how to share web resources(html,jsp,classes in WEB-INF/classes) ascoss wars in a single ear" Watch "how to share web resources(html,jsp,classes in WEB-INF/classes) ascoss wars in a single ear" New topic
Author

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

kumar chandrakar
Greenhorn

Joined: Dec 23, 2008
Posts: 3
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.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

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.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to share web resources(html,jsp,classes in WEB-INF/classes) ascoss wars in a single ear