• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

absolute & relative file addressing in Tiles

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the Struts forum.,
 
Chris Pat
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

<link rel="stylesheet" type="text/css" href="<html:rewrite page='/css/style.css'/>" />
<script language="javascript1.2" type="text/javascript" src="<html:rewrite page='/js/common.js'/>"></script>

- Brent
 
A day job? In an office? My worst nightmare! Comfort me tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic