tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkuhn...@apache.org
Subject svn commit: r566859 - in /tapestry/tapestry4/trunk/tapestry-framework/src: java/org/apache/tapestry/asset/ java/org/apache/tapestry/engine/ java/org/apache/tapestry/html/ test/org/apache/tapestry/asset/
Date Thu, 16 Aug 2007 21:25:29 GMT
Author: jkuhnert
Date: Thu Aug 16 14:25:28 2007
New Revision: 566859

URL: http://svn.apache.org/viewvc?view=rev&rev=566859
Log:
Disagreement with TAPESYRY-802.  There should be no reason to encode session information in
asset paths.   If they really need it for security purposes most non static assets will have
the md5 sum encoded anyways.

Modified:
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/asset/ContextAsset.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
    tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/asset/ContextAssetFactoryTest.java

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/asset/ContextAsset.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/asset/ContextAsset.java?view=diff&rev=566859&r1=566858&r2=566859
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/asset/ContextAsset.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/asset/ContextAsset.java
Thu Aug 16 14:25:28 2007
@@ -14,9 +14,6 @@
 
 package org.apache.tapestry.asset;
 
-import java.io.InputStream;
-import java.net.URL;
-
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.Location;
 import org.apache.hivemind.Resource;
@@ -25,10 +22,13 @@
 import org.apache.tapestry.IRequestCycle;
 import org.apache.tapestry.Tapestry;
 
+import java.io.InputStream;
+import java.net.URL;
+
 /**
- * An asset whose path is relative to the {@link javax.servlet.ServletContext}containing
the
+ * An asset whose path is relative to the {@link javax.servlet.ServletContext} containing
the
  * application.
- * 
+ *
  * @author Howard Lewis Ship
  */
 
@@ -47,7 +47,7 @@
         Defense.notNull(contextPath, "contextPath");
 
         _contextPath = contextPath;
-        
+
         _requestCycle = cycle;
     }
 
@@ -62,7 +62,7 @@
         if (_resolvedURL == null)
             _resolvedURL = _contextPath + getResourceLocation().getPath();
 
-        return _requestCycle.encodeURL(_resolvedURL);
+        return _resolvedURL;
     }
 
     public InputStream getResourceAsStream()
@@ -76,8 +76,8 @@
         catch (Exception ex)
         {
             throw new ApplicationRuntimeException(Tapestry.format(
-                    "ContextAsset.resource-missing",
-                    getResourceLocation()), ex);
+              "ContextAsset.resource-missing",
+              getResourceLocation()), ex);
         }
     }
 }

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java?view=diff&rev=566859&r1=566858&r2=566859
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java
Thu Aug 16 14:25:28 2007
@@ -196,8 +196,8 @@
         String result = buffer.toString();
         
         // TODO: This is somewhat questionable right now, was added in to support TAPESTRY-802
-        if (_cycle != null && _stateful) {
-            
+        if (_cycle != null && _stateful)
+        {    
             result = _cycle.encodeURL(result);
         }
         

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java?view=diff&rev=566859&r1=566858&r2=566859
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
Thu Aug 16 14:25:28 2007
@@ -105,7 +105,7 @@
             IAsset stylesheet = getStylesheet();
 
             if (stylesheet != null)
-                writeStylesheetLink(writer, cycle, stylesheet);
+                writeStylesheetLink(writer, stylesheet);
 
             Iterator i = (Iterator) getValueConverter().coerceValue(getStylesheets(), Iterator.class);
 
@@ -113,7 +113,7 @@
             {
                 stylesheet = (IAsset) i.next();
 
-                writeStylesheetLink(writer, cycle, stylesheet);
+                writeStylesheetLink(writer, stylesheet);
             }
         }
 
@@ -172,7 +172,7 @@
         }
     }
 
-    private void writeStylesheetLink(IMarkupWriter writer, IRequestCycle cycle, IAsset stylesheet)
+    private void writeStylesheetLink(IMarkupWriter writer, IAsset stylesheet)
     {
         writer.beginEmpty("link");
         writer.attribute("rel", "stylesheet");

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/asset/ContextAssetFactoryTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/asset/ContextAssetFactoryTest.java?view=diff&rev=566859&r1=566858&r2=566859
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/asset/ContextAssetFactoryTest.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/asset/ContextAssetFactoryTest.java
Thu Aug 16 14:25:28 2007
@@ -200,8 +200,6 @@
         IRequestCycle rc = newMock(IRequestCycle.class);
 
         trainGetResource(context, "/asset_fr.png", url);
-
-        trainEncodeURL(rc, "/context/asset_fr.png", "/context/asset_fr.png?encoded");
         
         replay();
 
@@ -213,7 +211,7 @@
 
         String assetUrl = factory.createAbsoluteAsset("/asset.png", Locale.FRENCH, l).buildURL();
 
-        assertTrue(assetUrl.endsWith("?encoded"));
+        assertEquals(assetUrl, "/context/asset_fr.png");
 
         verify();
     }



Mime
View raw message