Embedded HTML structure
The display context of the web application effects what HTML it should emit.
For example, when running standalone a "logout" link is appropriate; when running within a framework, a "logout" link usually isn't.
When running standalone with complete control of the browser page, or when running within an HTML frame or iframe, the application should produce a full legal XHMTL document, including "<html>", "<head>", and "<body>" tags.
On the other hand, when running as a portlet, or when embedded in another application's XHMTL page, the application should only produce what's legal within "<body>" tags. This means, for example, that application-specific CSS stylesheets or JavaScript files either have to be loaded by the embedding page or specified in "<link>" tags of doubtful legality. (It may also introduce name scoping issues for form elements, but let's not go there right now.)
As a cheap start toward this level of flexibility, the Sakai 2.0 Baseline Gradebook uses JSP 2's "prelude" and "coda" feature, which prefixes and suffixes pages based on the application configuration file. A standalone deployment might prefix a header with the gradebook's name and suffix a logout button; an embedded deployment would just leave those out.
As an added benefit, JSP preludes and codas let us strip a good amount of boilerplate out of the central application JSP pages.