Author: jkuhnert
Date: Tue Nov 28 14:55:35 2006
New Revision: 480263

URL: http://svn.apache.org/viewvc?view=rev&rev=480263
Log:
Resolves TAPESTRY-1161 . 

Modified:
    tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/pom.xml
    tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/config/jetty.xml
    
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java
    
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/LinkFactoryImpl.java
    
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/LinkFactoryTest.java

Modified: tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/pom.xml
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/pom.xml?view=diff&rev=480263&r1=480262&r2=480263
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/pom.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/pom.xml Tue Nov 28 
14:55:35 2006
@@ -88,7 +88,7 @@
     <build>
         <sourceDirectory>src/java</sourceDirectory>
         <testSourceDirectory>src/test</testSourceDirectory>
-
+        
         <plugins>
             <plugin>
                 <groupId>org.mortbay.jetty</groupId>

Modified: 
tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/config/jetty.xml
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/config/jetty.xml?view=diff&rev=480263&r1=480262&r2=480263
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/config/jetty.xml 
(original)
+++ tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/config/jetty.xml 
Tue Nov 28 14:55:35 2006
@@ -15,49 +15,12 @@
    limitations under the License.
 -->
 
-<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN"
-       "http://jetty.mortbay.org/configure.dtd";>
-<Configure class="org.mortbay.jetty.Server">
-    
-    <Set name="ThreadPool">
-      <New class="org.mortbay.thread.BoundedThreadPool">
-        <Set name="minThreads">10</Set>
-        <Set name="maxThreads">100</Set>
-      </New>
-    </Set>
-    
-    <Set name="connectors">
-      <Array type="org.mortbay.jetty.Connector">
-      
-        <Item>
-          <New class="org.mortbay.jetty.bio.SocketConnector">
-            <Set name="port">8080</Set>
-            <Set name="maxIdleTime">50000</Set>
-          </New>
-        </Item>
-      
-      </Array>
-    </Set>
-    
-   <Set name="handlers">
-      <Array type="org.mortbay.jetty.Handler">
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" 
"http://jetty.mortbay.org/configure.dtd";>
 
-        <!-- ======================================================= -->
-        <!-- Configure a test web application with web.xml           -->
-        <!-- ======================================================= -->
-        <Item>
-          <New id="demoContext"  
class="org.mortbay.jetty.webapp.WebAppContext">
-            <Set name="contextPath">/</Set>
-            <Set name="resourceBase">src/context</Set>
-            <Set name="VirtualHosts"><Array 
type="java.lang.String"></Array></Set>
-            <Get name="SessionHandler">
-              <Set name="SessionManager"><New 
class="org.mortbay.jetty.servlet.HashSessionManager"/></Set>
-            </Get>
-          </New>
-        </Item>
-       </Array>
-    </Set>
-   
-   <Set name="stopAtShutdown">true</Set>
-   <Call name="start"/>
+<Configure class="org.mortbay.jetty.webapp.WebAppContext" >
+    <Get name="sessionHandler">
+        <Get name="sessionManager">
+            <Set name="usingCookies" type="boolean">false</Set>
+        </Get>
+    </Get>
 </Configure>

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=480263&r1=480262&r2=480263
==============================================================================
--- 
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
 Tue Nov 28 14:55:35 2006
@@ -46,6 +46,8 @@
 
     private IRequestCycle _cycle;
     
+    private boolean _stateful;
+    
     private String _encoding;
 
     /** @since 4.0 */
@@ -85,6 +87,7 @@
         _encoding = encoding;
         _codec = codec;
         _request = request;
+        _stateful = stateful;
         _parameters = new QueryParameterMap(parameters);
     }
     
@@ -123,6 +126,7 @@
         _encoding = encoding;
         _codec = codec;
         _request = request;
+        _stateful = stateful;
         _parameters = new QueryParameterMap(parameters);
     }
 
@@ -187,12 +191,13 @@
             buffer.append('#');
             buffer.append(anchor);
         }
-
+        
         String result = buffer.toString();
         
         // TODO: This is somewhat questionable right now, was added in to 
support TAPESTRY-802
-        if (_cycle != null)
+        if (_cycle != null && _stateful) {
             result = _cycle.encodeURL(result);
+        }
         
         return result;
     }

Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/LinkFactoryImpl.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/LinkFactoryImpl.java?view=diff&rev=480263&r1=480262&r2=480263
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/LinkFactoryImpl.java
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/LinkFactoryImpl.java
 Tue Nov 28 14:55:35 2006
@@ -116,7 +116,7 @@
 
         String fullServletPath = _contextPath + 
serviceEncoding.getServletPath();
         
-        return new EngineServiceLink(fullServletPath, 
engine.getOutputEncoding(),
+        return new EngineServiceLink(_requestCycle, fullServletPath, 
engine.getOutputEncoding(),
                 _codec, _request, parameters, stateful);
     }
 

Modified: 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/LinkFactoryTest.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/LinkFactoryTest.java?view=diff&rev=480263&r1=480262&r2=480263
==============================================================================
--- 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/LinkFactoryTest.java
 (original)
+++ 
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/LinkFactoryTest.java
 Tue Nov 28 14:55:35 2006
@@ -164,6 +164,7 @@
 
         trainGetEngine(cycle, engine);
         trainGetOutputEncoding(engine, "utf-8");
+        trainEncodeURL(cycle, "/context/app?foo=bar&service=myservice", 
"/context/app?foo=bar&service=myservice&jsessionid=124");
         
         replay();
 
@@ -183,7 +184,7 @@
         
         ILink link = lf.constructLink(service, false, parameters, true);
         
-        assertEquals("/context/app?foo=bar&service=myservice", link.getURL());
+        assertEquals("/context/app?foo=bar&service=myservice&jsessionid=124", 
link.getURL());
 
         verify();
     }


Reply via email to