Yes, I think that would work. Only problem there is that I still
want to have all benefits of caching that the build-in services
deliver. And I can't see how to just *modify* the asset path
inside the dispatcher and pass it on to Tapestry...

/Andreas

On 28 mar 2008, at 15.36, Cordenier Christophe wrote:

And what about a custom AssetDispatcher ?

-----Message d'origine-----
De : Andreas Pardeike [mailto:[EMAIL PROTECTED]
Envoyé : vendredi 28 mars 2008 15:22
À : Tapestry users
Objet : Re: T5: Custom asset locator?

Thanks Christope, but it's not quite what I want. To illustrate
my problem, take a look at the request headers I want to process:

GET /assets/i/test.gif HTTP/1.1
Host: www.SITE_A.com

and

GET /assets/i/test.gif HTTP/1.1
Host: www.SITE_B.com

If I just create my own binding, the request urls would still contain
the real folder inside /assets and my requests would look like

GET /assets/SITE_A/i/test.gif HTTP/1.1
GET /assets/SITE_B/i/test.gif HTTP/1.1

which I rather not want.

/Andreas

On 28 mar 2008, at 15.10, Cordenier Christophe wrote:
Hello

I'm not sure this can help, this is just an idea,
but maybe it would be easier to create a new type of binding Factory
upon the AssetBinding factory to add dynamic datas.

Best regards,
Christophe.

-----Message d'origine-----
De : Andreas Pardeike [mailto:[EMAIL PROTECTED]
Envoyé : vendredi 28 mars 2008 14:58
À : Tapestry users
Objet : T5: Custom asset locator?

Hi everyone,

First: many many thanks to the list for all the valuable info I
get from it (either as passive reading or answers to my questions!)

My problem: I want to expand the virtual /assets mapping because
in the app I am writing, I use the current host name to run different
sites/layouts.

So I want to implement that

Host: www.SITE_A.com
<img src="${asset:classpath:/i/test.gif}" />
points to SITE_A/i/test.gif

and

Host: www.SITE_B.com
<img src="${asset:classpath:/i/test.gif}" />
points to SITE_B/i/test.gif

instead of the default way to do it by using

<img src="${asset:classpath:/CURRENTSITE/i/test.gif}" />
or @Path("classpath:${host}/i/test.gif")

and have it dynamically expand to the same paths. The motivation
behind
this is that

a) users at SITE_A could replace the url with 'SITE_B' and peek at
other
  resources

b) the url's get very long and for some reason I don't want to go into
  here, I need to match the URLs style with some dynamic paths that
  fetch resources from a db - there, I automatically take care of the
  host name.

I couldn't find a example on how to expand/overwrite asset lookup (in
the same way I expanded template lookup). All I want is to add a
subfolder on the fly to the asset path and still use the same build
in asset service.

/Andreas Pardeike

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to