You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2009/12/18 00:01:22 UTC

svn commit: r891969 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java

Author: lu4242
Date: Thu Dec 17 23:01:21 2009
New Revision: 891969

URL: http://svn.apache.org/viewvc?rev=891969&view=rev
Log:
MYFACES-2460 Add Resource Headers and allow EL Expressions only on css files

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java?rev=891969&r1=891968&r2=891969&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/ResourceImpl.java Thu Dec 17 23:01:21 2009
@@ -22,21 +22,14 @@
 import java.io.InputStream;
 import java.io.PushbackInputStream;
 import java.net.URL;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Calendar;
 import java.util.Collections;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
-import java.util.TimeZone;
 
 import javax.el.ELContext;
 import javax.el.ValueExpression;
-import javax.faces.application.ProjectStage;
 import javax.faces.application.Resource;
 import javax.faces.application.ResourceHandler;
 import javax.faces.context.FacesContext;
@@ -90,9 +83,8 @@
     {
         String contentType = getContentType();
 
-        return ("text/css".equals(contentType)/* || 
-            "text/javascript".equals(contentType) || 
-            "application/x-javascript".equals(contentType)*/ );
+        return ("text/css".equals(contentType) ||
+               ( "jsf.js".equals(getResourceName()) && "javax.faces".equals(getLibraryName())));
     }
 
     private class ValueExpressionFilterInputStream extends InputStream
@@ -205,12 +197,14 @@
         }
  
         String metadata = null;
+        boolean useAmp = false;
         if (getLibraryName() != null)
         {
             metadata = "?ln=" + getLibraryName();
             path = path + metadata;
+            useAmp = true;
         }
-                
+        
         return FacesContext.getCurrentInstance().getApplication().
             getViewHandler().getResourceURL(
                     FacesContext.getCurrentInstance(), path);