On 9/11/05, Frank Carnovale
<[EMAIL PROTECTED]> wrote:
> Yes, I thought that.
> 
> It makes no sense passing static browser-side resources (images, javascripts, 
> css) through the Maypole logic, and therefore through the TT logic, which has 
> to scan for [% %] sections.  Unless you really want them all to fall into the 
> same Maypole security regime, as a practical solution I suggest arranging 
> your URL namespace to keep /scripts, /styles and /images outside the 
> /mymaypoleapp handler.
> 
> frank
> 

After some long hard experimenting I have found what frank suggests to
be right on.  I found that Maypole will process  files you intend to
be static if

 1)  You use relative URIs in the templates  (no big surprise but
potentially dangerous cosequences. IE <img src="beer_icon.gif"> in the
list template will cause Maypole to try to run $beer->beer_icon.gif. 
It is stopped at the is public check in my case. )

2)  If your files reside in a folder named after your <Location
/beerdb>  in the top level of the document root.  Ex: If  maypole.css
is in DOCROOT/beerdb/maypole.css and in the header you link to it like
"href=/maypole.css"   then maypole will process it and all absolute
URIs .

It works to put a 
<Location /beerdb/static> 
   SetHandler default-handler
</Location>  

But /beerdb HAS to be in the top level of document root.  
My conclusion was same as franks  -- move static files out of URI
space altogether and the extra Location handler is not needed at all. 
 However this means you are limited to using absolute URIs in the
templates.   Since maypole uri s map to models and actions relative
uris don't seem that useful anyway.

So here is a setup i think makes sense that I am going to try

<Location /beerdb> 
     SetHandler BeerDB
</Location>

DocumentRoot /usr/local/apache2/htdocs/myserver
template root : /usr/local/apache2/htdocs/myserver/beerdb_docroot
static  put       : /usr/local/apache2/htdocs/myserver/beerdb_docroot



 There now I can keep all the stuff for my app in one directory and 
as long as I use absolute URIs in html code,  Maypole wont process
anything except the original request.  I can save relative URIs for
stuff that needs authenticating.  This is my final conclusion I just
arrived at.

Heres a oneliner  for the Maypole docs: 

Name your application's document directory different than its URI base
and use absolute URIs in your html and Maypole will not process style
sheets and images that you would rather the server process.
 

Peter: WOW Peter. That was really a lot of toil and trouble just
realize all you need to do is  change the name of the directory of
your app's ht docs.

Peter: Who asked you? 

cheers


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to