This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I have done a combination of this before, using a <jsp:include> that would include a jsp, that renders the <link> tag for css.
the included file is a jsp, that contains the <link>tag to load either the external style sheet, or an inline style sheet, still within the <link> tag.
when i make a seperate file to put my css <link> tags, and other header type things that are common to all pages in my site, it saves me from having to cut-paste across all top level pages when something changes. It is sort of like server side templating / organization of your conent. If you are used using the tiles framework, or similar, this jsp:include model fits nicely with the <tiles:insert> tags.
The motivation of using <jsp:include would render the contents of the seperate my_header.jsp is that the jsp becomes its own servlet, so the invocation is more like a function call, as opposed to if you <%@ include %> 'd it, then it would be verbatim inline with the calling servlet, which IMHO makes makes each file slighly unnecessarily larger and may at times (conspiracy theroy) take a little longer for the JSPs to compile (when you have hundreds) I also prefer the <jsp:include over the <%@ include %> as I have noticed sometimes, on older (websphere) app servers do not always know to recompile a JSP when the <%@ include %>'d file is changed.
Error: Keyboard not attached. Press F1 to continue.
I'd say that the decision to use an include directive vs. an include action should be made depending on whether it makes sense for a separate (sub)request to be made to the resource or not --not to get around a container issue.