Originally posted by Eric Sexton:
I should have explained it a bit better. This is a methodology that will make the 'mouse over' images for buttons loaded right away into the browser cache with JavaScript. I use the onLoad event of the body tag.
So without having a body tag for each individual jsp because of the use of tiles, I'm stuck.
I still don't see how this would matter. JavaScript is processed by the client, not when the tiles are being put together so again, the JSP engine has nothing to do with loading your images.
Each JSP does not have to have its own body tag. You can have the body tag and the JavaScript that preloads the images in the layout and all the content in your tiles. The only thing you can't do is to have the opening and closing tags of custom JSP tags on separate pages. Other than that you shouldn't have any problem splitting the content into separate JSPs. When the tiles are all put together they go back to the client as a single HTML page.
Example:
// layout.jsp
<html:html>
<script type="text/javascript" language="JavaScript"
src="<tiles:getAsString name="imageLoadScript" />" />
<body on load="<tiles:getAsString name="imageLoadScriptProcName">" >
<tiles:insert attribute="header" />
<tiles:insert attribute="body" />
<tiles:insert attribute="footer" />
</body>
</html:html>
then in your tiles-def, you can just define puts:
<put name="imageLoadScript" value="myMenuImages.js" />
<put name="imageLoadScriptProcName" value="preLoadMenuImages()" />
You don't even have to make it that complicated if you have only one script to preload your images -- just plug the names in directly into the layout.
[ October 24, 2003: Message edited by: Junilu Lacar ]