Hmm..
Have you actually tried using the compile-time include? As far as I can tell, it should just work. All the code you show will just be included as if you had typed it into the calling JSP.
If for some reason it doesn't, there are loads of cunning tricks for simulating dynamism on static pages, depending on how much architecture flexibility you have Most of them assume that if an unauthorized user were to try and send a request for the admin console they would be blocked. I really hope you do this anyway, as you've got a big security hole otherwise. Most of them are also used to add dynamic advertising to static pages.
Idea one. Leave the button always on the page, but hide it with CSS. If you have your page fetch a CSS stylesheet, you can generate the the CSS stylesheet itself using a JSP (or a
servlet). This way it is easy enough to make the admin button invisible, off the screen or whetever, if the user is not authorized to see it.
Idea two. Leave the button always on the page, but hide it with Javascript. Similarly, if your page includes an external JavaScript file, that can be tailored to the roles of the user.
Idea three. redirect "admin" users to a parallel URL tree This is a trick I have used successfully to give the appearance of dynamic sites from a static web server. Normal pages might have URLs like
http://server/application/public/whatever.jsp The same pages with the "admin" button have URLs like:
http://server/application/admin/whatever.jsp In the "Logon" processing, simply redirect the logged in user to the appropriate URL-tree, and if an unauthorized user tries to request an "admin" page, just redirect to the public one.
This approach is a pain if you are hand-generating your pages, but if you are using a templating or code-generating site-builder tool to add your navigation and so on it should be pretty easy.
Idea four. split your footer Put the dynamic bit into a bean or a custom tag to reduce the amount of code in the JSP, then just @include the static (copytright etc.) bit:
or
Has any of this helped?