You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Fernando Padilla <fe...@alum.mit.edu> on 2008/03/18 05:46:04 UTC

[T5] url asset prefix?

I'm sorry, but I can't remember if this was discussed in the mailing list..

but I want to do something like:

@Inject
@Path( "url:http://blah" )
private Asset blahJs;


Has T5 added something built in for that yet?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] url asset prefix?

Posted by Fernando Padilla <fe...@alum.mit.edu>.
here is one example:

If I have a component that wants to bring in css and js, I don't want to 
just bring that in multiple times, every time the component is used.. 
going through the addStylesheet and addScriptLink methods is the 
Tapestry way of doing it.. makes sure duplicates aren't brought in.. and 
it generalizes really really well:

For example, I develope Facebook apps, which until recently did not 
support referencing outside js/css files, so I simply created a 
PageRenderSupport integration that would squirt in the contents of the 
js/css instead of putting in references to them (default behavior).  So 
I could develop pretty much independent of html/facebook.. and it just 
worked.


(though the next thing I'll be looking into, is a way to add a unique 
token to the end of asset urls.. so that I can turn on full caching and 
not worry about staleness..)




Jonathan Barker wrote:
> One of the features of Assets is localization.  I don't see how that would
> work with the url prefix.
> 
> Is there a reason whey you don't want to use a url right in your template,
> or perhaps in a message file?  Actually, if you used a message file then you
> could localize the asset.
> 
> Jonathan
> 
> 
>> -----Original Message-----
>> From: Fernando Padilla [mailto:fern@alum.mit.edu]
>> Sent: Tuesday, March 18, 2008 12:46 AM
>> To: Tapestry users
>> Subject: [T5] url asset prefix?
>>
>> I'm sorry, but I can't remember if this was discussed in the mailing
>> list..
>>
>> but I want to do something like:
>>
>> @Inject
>> @Path( "url:http://blah" )
>> private Asset blahJs;
>>
>>
>> Has T5 added something built in for that yet?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: [T5] url asset prefix?

Posted by Jonathan Barker <jo...@gmail.com>.
One of the features of Assets is localization.  I don't see how that would
work with the url prefix.

Is there a reason whey you don't want to use a url right in your template,
or perhaps in a message file?  Actually, if you used a message file then you
could localize the asset.

Jonathan


> -----Original Message-----
> From: Fernando Padilla [mailto:fern@alum.mit.edu]
> Sent: Tuesday, March 18, 2008 12:46 AM
> To: Tapestry users
> Subject: [T5] url asset prefix?
> 
> I'm sorry, but I can't remember if this was discussed in the mailing
> list..
> 
> but I want to do something like:
> 
> @Inject
> @Path( "url:http://blah" )
> private Asset blahJs;
> 
> 
> Has T5 added something built in for that yet?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org