I just thought I'd share my experience with this one... and I'd love to hear
about alternate ways that involve even less code! Although this isn't bad at
all. Anyway:

Here's what I needed to put in the html:

<style type="text/css" media="screen">
   <!-- This is an IE6 and below hack to make the menu work. -->
   body{ behavior: url(/scripts/csshover2.htc); }
</style>

Note the path to csshover2.htc, obviously it's going to break if I don't get
the context path in there. Here's my solution:

<style type="text/css" media="screen">
   <!-- This is an IE6 and below hack to make the menu work. -->
   body{ behavior: url(); }
</style>

And:

   @Asset("/scripts/csshover2.htc")
   public abstract IAsset getCssHoverScript();

In the backing class.

Now I can run the app with any context path I like, for example
'squirrelycontext', and the asset will generate
'/squirrelycontext/scripts/csshover2.htc' for my HTML.

Cheers,
Jim

-- 
View this message in context: 
http://www.nabble.com/-T4--One-way-to-get-the-context-path-when-you-need-to-inject-it-straight-into-HTML-tf4735543.html#a13542208
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to