Hello I am learing tiles and am unclear on the issue of file locations. Lets say I have my layouts00.jsp under layouts under web-inf WEB-INF:Layouts:layouts00.jsp and I have WEB-INF:Style00:header00.jsp|body00.jsp|footer.jsp
My questions are on the tiles-definition spec and where is the resultant html generated. 1. would a line in the definition be like this: <put name="header" value="/Style00/header00.jsp" /> iow, from the tiles-definition can I just relatively address the files that I am subsituting for this definiton? 2. What is the final location of the rendered html? I have customer jscript functions that need to be loaded and custom css that need to be relatively addressed from resultant html. Do I put those in WEB-INF:Style00: JspCssStuff? Sorry for the unsophistication of this question, its a beginning.
Originally posted by Bear Bibeault: Moved to the Struts forum.,
Hello Also is it possible to load jscript and css with tiles such that they work? I assume I need to do something with flush. Possibly dont flush until the page is rendered but not presented then somehow flush to browser and let it automagically find and activate the jscript and css? What is the proper way for this type of synthetic complex page generation? tia.
Joined: Feb 08, 2006
I am not an expert in this area, but I might be able to help out. Since the browser loads the css and js files separately, then need to be in a directory that is accessible by the outside world. Files under your WEB-INF directory cannot be accessed, so you cannot put your css and js files there.
Do you really need to access files relatively? My memory tells me that relative paths need to be from the location of the base tile file. I am not sure where the html:base tag fits into this. As I recall we had the html:base tag in our default layout jsp but that caused us problems in production which uses https and an accelerator.
Here are a couple lines of code to load css and js files using absolute paths using the html:rewrite tag: