You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Carsten Klein <ca...@axn-software.de> on 2012/08/01 16:20:13 UTC

Re: META-INF/assets/ in 5.4


Hi,

as far as Java Web Application "standards" go, the static assets, but not
normally the page a/o component templates, can be found under
WEBAPP-ROOT/js etc.

I think that tapestry 5 should stick to the established principles instead
of reinventing the wheel.

Also, I do not see why this should impose problems on the user, as the
users are already accustomed to that practice.

As for the templates, I think you should go for a templates/ subfolder,
located directly under WEBAPP-ROOT, or a tapestry5 subfolder. Either would
be fine with me.

However, I am still wondering how an application that consists of multiple
modules that are deployed separatedly in form of external libraries would
be able to contribute the static resources found in those libraries so
that they can be served directly from the filesystem instead of from
inside a jar.

Regards,

Carsten

> Here's the thing: I want to have ONE simple thing to describe and
> document.
>
> These endless chains of options are a tax on users:  they are harder
> to document, harder for users to determine what the "right" approach
> is, require more code and more tests. If you've read the book "The
> paradox of choice" you'll realize that giving users lots of options is
> a way of shirking responsibility for making a real decision.  I regret
> some of my "you can have it your way" design choices in the past,
> though I don't think any of them are that crippling (though allowing
> page templates in the web context was a huge mistake).
>
> In any case, the question is where to put the files; I'm open to
> META-INF/assets/ or T5-RESOURCES/assets/ or META-INF/tapestry/assets/
> or TAPESTRY/assets/ or something along those lines.
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


--
Carsten Klein
Mobile +491 577 666 256 5
carsten.klein@axn-software.de

www.axn-software.de
info@axn-software.de



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


Re: META-INF/assets/ in 5.4

Posted by Howard Lewis Ship <hl...@gmail.com>.
On Wed, Aug 1, 2012 at 7:20 AM, Carsten Klein
<ca...@axn-software.de> wrote:
>
>
> Hi,
>
> as far as Java Web Application "standards" go, the static assets, but not
> normally the page a/o component templates, can be found under
> WEBAPP-ROOT/js etc.

>
> I think that tapestry 5 should stick to the established principles instead
> of reinventing the wheel.

Someone should have told me this about 10 years ago!

>
> Also, I do not see why this should impose problems on the user, as the
> users are already accustomed to that practice.

For application resources, you can absolutely put assets in the web
context, and use the "context:" prefix to reference them.

Much of this discussion is about how to handle assets inside
libraries, including critical ones provided as part of
tapestry-core.jar.  A big feature of Tapestry vs. many other
frameworks (on Java and other platforms) is that this is handled
seamlessly and automatically, without extra unpackaging, copying, or
configuration.

>
> As for the templates, I think you should go for a templates/ subfolder,
> located directly under WEBAPP-ROOT, or a tapestry5 subfolder. Either would
> be fine with me.

Templates are a server-side resource; they belong with compiled Java
classes, on the classpath, in the package with the component class.

>
> However, I am still wondering how an application that consists of multiple
> modules that are deployed separatedly in form of external libraries would
> be able to contribute the static resources found in those libraries so
> that they can be served directly from the filesystem instead of from
> inside a jar.
>

Serving from the file system is not ideal; Tapestry does a lot of
extra work to improve things:
- versioned URL
- far future expires header
- response compression
- caching of compressed assets
- JavaScript aggregation
- JavaScript minimization (well, still working on getting that solid)
- hooks to support content deliver networks

> Regards,
>
> Carsten
>
>> Here's the thing: I want to have ONE simple thing to describe and
>> document.
>>
>> These endless chains of options are a tax on users:  they are harder
>> to document, harder for users to determine what the "right" approach
>> is, require more code and more tests. If you've read the book "The
>> paradox of choice" you'll realize that giving users lots of options is
>> a way of shirking responsibility for making a real decision.  I regret
>> some of my "you can have it your way" design choices in the past,
>> though I don't think any of them are that crippling (though allowing
>> page templates in the web context was a huge mistake).
>>
>> In any case, the question is where to put the files; I'm open to
>> META-INF/assets/ or T5-RESOURCES/assets/ or META-INF/tapestry/assets/
>> or TAPESTRY/assets/ or something along those lines.
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator of Apache Tapestry
>>
>> The source for Tapestry training, mentoring and support. Contact me to
>> learn how I can get you up and productive in Tapestry fast!
>>
>> (971) 678-5210
>> http://howardlewisship.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>
>>
>
>
> --
> Carsten Klein
> Mobile +491 577 666 256 5
> carsten.klein@axn-software.de
>
> www.axn-software.de
> info@axn-software.de
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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