<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> </HEAD>But what happens when you want it to be javascript?<br/><br/>Then your script would be parsed as EL<br/><br/>An interesting problem<p>Sent from my Verizon Wireless BlackBerry</p><p><hr size=2 width=100% align=center tabindex=-1><b>From</b>:  Werner Punz <werner.punz@gmail.com><br><b>Date</b>: Thu, 24 Sep 2009 16:13:58 +0200<br><b>To</b>: &lt;jsr-314-open@jcp.org&gt;<br><b>Subject</b>: Re: [jsr-314-open] Evaluating EL in resource files<br></font></p>Hello, not sure if I can or am allowed to post, but I am giving it a try.<br><br>The -el.js extension seems somewhat strange there is no single equivalent anywhere in  since javascripts are treated like templates, I <br>would recommend another syntax and leave the el parsing open for any file.<br><br>Something along the lines of jsf.el(#{resource[&#39;this:scripts.<div id=":v0" class="ii gt">js&#39;]}</div>) which then is resolved into /jsf-ezcomp02/javax.faces.<div id=":v0" class="ii gt">resource/scripts.js<br><br> jsf.el looks like javascript in this case but is just a directive which means that the embedded expression is an el expression and no javascript.<br><br>The parsing then would happen agnostic to any library in before serving.<br><br><br><br>Werner<br><br></div><br><br><div class="gmail_quote">On Thu, Sep 24, 2009 at 3:53 PM, Ed Burns <span dir="ltr">&lt;<a href="mailto:Ed.Burns@sun.com">Ed.Burns@sun.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Greetings EG,<br><br> We have two problems here.  First, let me restate the intent of the<br> feature.<br><br> FEATURE SHORT DESCRIPTION:<br> ==========================<br><br> Let JSF2 resources refer to other resources in a way that the browser<br> can make GET requests to load them via the ResourceHandler.<br><br> RATIONALE for FEATURE:<br> ======================<br><br> CSS files may refer to other files using the following syntax<br><br> url( some URL )<br><br> The url() element may appear in several places in a CSS file, most<br> commonly to the right of @import, as in<br><br> @import url(layout.css)<br> @import url(typography.css)<br> @import url(colorAndMedia.css)<br><br> Unfortunately, this doesn&#39;t &quot;just work&quot; when the CSS file in question is<br> in a JSF resource library, for obvious reasons.<br><br> The solution we chose was to allow EL expressions in CSS files.  That<br> way, you could say this in your css file:<br><br> @import url(#{resource[&#39;this:layout.css&#39;]})<br> @import url(#{resource[&#39;this:typography.css&#39;]})<br> @import url(#{resource[&#39;this:colorAndMedia.css&#39;]})<br><br> and when the file actually gets served up it would look like:<br><br> @import url(/jsf-ezcomp02/javax.faces.resource/layout.css.jsf?ln=ezcomp);<br> @import url(/jsf-ezcomp02/javax.faces.resource/typography.css.jsf?ln=ezcomp);<br> @import url(/jsf-ezcomp02/javax.faces.resource/colorAndMedia.css.jsf?ln=ezcomp);<br><br> PROBLEM 1. This behavior should have been specified in the javadocs for<br> Resource.getInputStream().  I&#39;ve added this to the ChangeLog.<br><br> PROBLEM 2.  JavaScript resources have the same problem; they can refer<br> to other javascript files and the browser needs to know how to fetch<br> them.  We employed the same solution: put EL in there and it gets<br> evaluated on the way out.<br><br> Unfortunately, the prototype JavaScript library uses #{} to mean<br> something important.<br><br> SUGGESTED SOLUTION to PROBLEM 2.<br><br> Let&#39;s assume PROBLEM 1 didn&#39;t exist.  I suggest we modify the spec for<br> getInputStream() to say that all resources EXCEPT JavaScript resources,<br> must do the EL evaluation on the way out.  We need some way for users to<br> enable the feature for JavaScript resources because, let&#39;s face it, not<br> everyone uses prototype.  Ryan and I suggest we adopt a protocol that<br> says, &quot;if the resource name ends in &#39;-el&#39; we always turn on the EL<br> evaluation on the way out&quot;.<br><br> Thoughts?<br><br> Ed<br><font color="#888888"><br> --<br> | <a href="mailto:ed.burns@sun.com">ed.burns@sun.com</a>  | office: 408 884 9519 OR x31640<br> | homepage:         | <a href="http://ridingthecrest.com/" target="_blank">http://ridingthecrest.com/</a><br></font></blockquote></div><br>  </html>