• 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

include a file between webapps

 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a header file which I'd like to share between multiple webapps. Is this possible? The directory structure is below:

webapps/ist/includes/header.jsp
webapps/forms/includes/header.jsp


It seems silly to have to duplicate the header.jsp file just because these are in different webapps. Especially since I'm using single sign on. But none of the below work:



Am I going to be forced to duplicate this header.jsp page?

Thanks,
Jim
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

It seems silly to have to duplicate the header.jsp file just because these are in different webapps.



Sorry, but silly as it may seem to you, sharing resources across webapps is not a good idea. As you have seen, the mechanisms inherent in web application containers (as outlined in the specifications) focus heavily on making web applications self-contained units.

Trying to create artificial bindings between discrete web applications is not only technically difficult (because you are bucking the intentions of the specifications), but is just bad architectural design as it creates artificial dependencies between the apps.

Rather, you can have a single source for the shared resource, but copy it to each web application as necessary during the automated build process. This way, you manage the shared resource at build time, rather than trying to do so with execution-time mechanisms.
[ August 18, 2005: Message edited by: Bear Bibeault ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic