Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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: 67651
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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic