Hi all,
I am wondering why we don't adapt the approach introduced with JSF 2.
CSS, JS and images can either be packed into
WebRoot/resources
or into
META-INF/resources of a JAR
The advantage of this approach is that there is no need for a kind of
bogus regex or assumptions on what most users would like to show form
the class path. Even on pictures, you cannot assume that this is wanted
by default. May be people are hiding pictures in the class path and only
show them to logged in users.
Defining a dedicated folder makes it pretty clear where to put things
you would like to show to the outside.
I would sacrify security and expected behaviour (classpath is by default
protected) to backwards compatibility.
A second benefit we could adapt from the JSF 2 approach is the
possibility to deliver resources depending on languages and versions
Sample
webroot/resources/de/js/default.js/1.0.js
webroot/resources/de/js/default.js/1.1.js
webroot/resources/en/js/default.js/1.0.js
A user with a german locale (de), using the following tag will get the
newest version of the German script
webroot/resources/de/js/default.js/1.1.js
<h:outputScript library="js" name="default.js" />
A page could use an older version as well. It just needs to specify the
resourceVersion.
<h:outputScript library="js" resourceVersion="1.0" name="default.js" />
What do you think?
--
Best Regards / Viele Grüße
Sebastian Hennebrueder
-----
Software Developer and Trainer for Hibernate / Java Persistence
http://www.laliluna.de
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]