We're developing several web apps that sit behind a single 'portal' app (all JEE 6). All apps are (currently) on the same glassfish server and use glassfish's SSO features, so the user logs in through the portal and can then use whichever apps they have permission to access.
I'm currently trying to figure out ways of encapsulating content that is the same or very similar across apps, and keep it in one place. Stuff like headers, footers, menus, dialogs, some common js/jquery tools, etc. Note that most of this is not static content (it needs to get some data from the server side). We use JSF 2.1 facelets with some primefaces and lots of custom components and so forth.
Ideally, I'd love for each sub-app to simply display various <ui:composition>
xhtml files from the portal app using <ui:include>
, or use a common template served by the portal app. This doesn't seem possible across domains, though. I could perhaps use <iframe>
s, but this seems pretty clunky, especially when the content relies on ajax and/or javascript files, etc.
Sorry if this question is a bit broad, but does anyone have any suggestions? What tech should I be looking into in order to embed common content in multiple apps? Is this a common pattern or are we making a poor architectural choice by splitting things up like this? Should we just be writing one giant UberApp?