I’m submitting a patch to enable HTTP / HTTPS protocol switching that comes on the heels of a couple of days of research. Hope you dig it! Here’s the background on why and what I did:

 

  1. First, I tried to get the container do it. Unfortunately, Tomcat is good about getting you into HTTPS using a <security-constraint>, but not out. There’s no way to specify that a resource / page *must* be accessed with HTTP.
  2. So, I setup redirects in Tapestry. I added a property to my BasePage (BasePage.secure) that indicates whether or not the page should be accessed with HTTPS. Then in the BasePage.pageValidate method, I throw a redirect to switch the protocol from http > https OR https > http as necessary. This works, but if a listener method in PAGE-A (set for http access) uses the RequestCycle to activate PAGE-B (set for http access), then the pageValidate method of PAGE-B throws a redirect to switch back to HTTP, the browser makes a request for PAGE-A again using http, and the app’s caught in an infinite redirect loop.
  3. So, I setup the BasePage.pageValidate to just allow access when https is used. But now the app has the same problem it had when I had redirects working in tomcat: it can’t get back to http.
  4. So, I created a new ILinkRenderer that grabs the page name from its underlying ILink, uses a PageSpecificationResolver to grab the page specification, check for the declaration of BasePage.secure, and call getAbsoluteUrl of the underlying ILink as necessary to output an HTTP or HTTPS link. It works pretty well. But it doesn’t work for Forms, only for AbstractLinkComponent and its descendents. And it’s hard to grab the page name from the ILink at this point in rendering –  after the LinkFactoryImpl applies ServiceEncoders that mess everything up.
  5. At this point I decided to stop hacking around the issue and patch the source. I gave EngineServiceLink two new parameters: _scheme and _port. When a client calls EngineServiceLink.getUrl(), EngineServiceLink checks its _scheme and _port properties. If _scheme is not specified or the same as the scheme used to make the current request, getUrl() does exactly what it did before: it returns a relative url. If _scheme is specified and not equal to the scheme used to make the current request, getUrl() returns an absolute URL with the specified scheme and port through its getAbsoluteUrl method. Then I set up my engine services to check for the BasePage.secure property (what the custom ILinkRenderer did before) and override the default scheme and port for the link.
  6. Of course, I updated all the references to LinkFactoryImpl.constructUrl in the default engine services and tests.

 

Here’s the patch:

 

 

 

 

 

Index: 
examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartService.java,v
retrieving revision 1.10
diff -u -r1.10 ChartService.java
--- 
examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartService.java
   18 Apr 2005 17:09:04 -0000      1.10
+++ 
examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartService.java
   10 Aug 2005 05:51:44 -0000
@@ -67,7 +67,7 @@
         parameters.put(ServiceConstants.PAGE, 
component.getPage().getPageName());
         parameters.put(ServiceConstants.COMPONENT, component.getIdPath());
 
-        return _linkFactory.constructLink(cycle, parameters, true);
+        return _linkFactory.constructLink(cycle, parameters, true, null, 0);
     }
 
     public void service(IRequestCycle cycle) throws IOException
Index: framework/src/java/org/apache/tapestry/asset/AssetService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/java/org/apache/tapestry/asset/AssetService.java,v
retrieving revision 1.17
diff -u -r1.17 AssetService.java
--- framework/src/java/org/apache/tapestry/asset/AssetService.java      9 Jul 
2005 01:38:16 -0000       1.17
+++ framework/src/java/org/apache/tapestry/asset/AssetService.java      10 Aug 
2005 05:51:45 -0000
@@ -165,7 +165,7 @@
 
         // Service is stateless, which is the exception to the rule.
 
-        return _linkFactory.constructLink(cycle, parameters, false);
+        return _linkFactory.constructLink(cycle, parameters, false, null, 0);
     }
 
     public String getName()
Index: framework/src/java/org/apache/tapestry/engine/ActionService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/ActionService.java,v
retrieving revision 1.12
diff -u -r1.12 ActionService.java
--- framework/src/java/org/apache/tapestry/engine/ActionService.java    18 Apr 
2005 17:06:37 -0000      1.12
+++ framework/src/java/org/apache/tapestry/engine/ActionService.java    10 Aug 
2005 05:51:45 -0000
@@ -77,7 +77,7 @@
         parameters.put(ACTION, asp.getActionId());
         parameters.put(ServiceConstants.SESSION, stateful ? "T" : null);
 
-        return _linkFactory.constructLink(cycle, parameters, true);
+        return _linkFactory.constructLink(cycle, parameters, true, null, 0);
     }
 
     public void service(IRequestCycle cycle) throws IOException
Index: framework/src/java/org/apache/tapestry/engine/DirectService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/DirectService.java,v
retrieving revision 1.13
diff -u -r1.13 DirectService.java
--- framework/src/java/org/apache/tapestry/engine/DirectService.java    18 Apr 
2005 17:06:37 -0000      1.13
+++ framework/src/java/org/apache/tapestry/engine/DirectService.java    10 Aug 
2005 05:51:45 -0000
@@ -82,7 +82,7 @@
         parameters.put(ServiceConstants.SESSION, stateful ? "T" : null);
         parameters.put(ServiceConstants.PARAMETER, dsp.getServiceParameters());
 
-        return _linkFactory.constructLink(cycle, parameters, true);
+        return _linkFactory.constructLink(cycle, parameters, true, null, 0);
     }
 
     public void service(IRequestCycle cycle) throws IOException
Index: framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java,v
retrieving revision 1.10
diff -u -r1.10 EngineServiceLink.java
--- framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java        
18 Apr 2005 17:06:37 -0000      1.10
+++ framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java        
10 Aug 2005 05:51:46 -0000
@@ -22,6 +22,7 @@
 import org.apache.hivemind.util.Defense;
 import org.apache.tapestry.IRequestCycle;
 import org.apache.tapestry.Tapestry;
+import org.apache.tapestry.services.ServiceConstants;
 import org.apache.tapestry.util.QueryParameterMap;
 import org.apache.tapestry.web.WebRequest;
 
@@ -47,7 +48,11 @@
     private final URLCodec _codec;
 
     private String _encoding;
-
+    
+    private int _port;
+    
+    private String _scheme;
+    
     private boolean _stateful;
 
     /** @since 4.0 */
@@ -77,7 +82,7 @@
      */
 
     public EngineServiceLink(IRequestCycle cycle, String servletPath, String 
encoding,
-            URLCodec codec, WebRequest request, Map parameters, boolean 
stateful)
+            URLCodec codec, WebRequest request, Map parameters, boolean 
stateful, String scheme, int port)
     {
         Defense.notNull(cycle, "cycle");
         Defense.notNull(servletPath, "servletPath");
@@ -93,6 +98,8 @@
         _request = request;
         _parameters = new QueryParameterMap(parameters);
         _stateful = stateful;
+        _scheme = scheme;
+        _port = port;
     }
 
     public String getURL()
@@ -102,7 +109,10 @@
 
     public String getURL(String anchor, boolean includeParameters)
     {
-        return constructURL(new StringBuffer(), anchor, includeParameters);
+        if(_scheme == null || _scheme.equals(_request.getScheme()))
+            return constructURL(new StringBuffer(), anchor, includeParameters);
+        else
+            return getAbsoluteURL(_scheme, null, _port, anchor, 
includeParameters);
     }
 
     public String getAbsoluteURL()
Index: framework/src/java/org/apache/tapestry/engine/ExternalService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/ExternalService.java,v
retrieving revision 1.12
diff -u -r1.12 ExternalService.java
--- framework/src/java/org/apache/tapestry/engine/ExternalService.java  18 Apr 
2005 17:06:37 -0000      1.12
+++ framework/src/java/org/apache/tapestry/engine/ExternalService.java  10 Aug 
2005 05:51:46 -0000
@@ -130,7 +130,7 @@
         parameters.put(ServiceConstants.PAGE, esp.getPageName());
         parameters.put(ServiceConstants.PARAMETER, esp.getServiceParameters());
 
-        return _linkFactory.constructLink(cycle, parameters, true);
+        return _linkFactory.constructLink(cycle, parameters, true, null, 0);
     }
 
     public void service(IRequestCycle cycle) throws IOException
Index: framework/src/java/org/apache/tapestry/engine/HomeService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/HomeService.java,v
retrieving revision 1.12
diff -u -r1.12 HomeService.java
--- framework/src/java/org/apache/tapestry/engine/HomeService.java      18 Apr 
2005 17:06:37 -0000      1.12
+++ framework/src/java/org/apache/tapestry/engine/HomeService.java      10 Aug 
2005 05:51:46 -0000
@@ -55,7 +55,7 @@
 
         parameters.put(ServiceConstants.SERVICE, Tapestry.HOME_SERVICE);
 
-        return _linkFactory.constructLink(cycle, parameters, true);
+        return _linkFactory.constructLink(cycle, parameters, true, null, 0);
     }
 
     public void service(IRequestCycle cycle) throws IOException
Index: framework/src/java/org/apache/tapestry/engine/PageService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/PageService.java,v
retrieving revision 1.10
diff -u -r1.10 PageService.java
--- framework/src/java/org/apache/tapestry/engine/PageService.java      18 Apr 
2005 17:06:37 -0000      1.10
+++ framework/src/java/org/apache/tapestry/engine/PageService.java      10 Aug 
2005 05:51:46 -0000
@@ -49,7 +49,7 @@
         parameters.put(ServiceConstants.SERVICE, Tapestry.PAGE_SERVICE);
         parameters.put(ServiceConstants.PAGE, parameter);
 
-        return _linkFactory.constructLink(cycle, parameters, true);
+        return _linkFactory.constructLink(cycle, parameters, true, null, 0);
 
     }
 
Index: framework/src/java/org/apache/tapestry/engine/ResetService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/ResetService.java,v
retrieving revision 1.10
diff -u -r1.10 ResetService.java
--- framework/src/java/org/apache/tapestry/engine/ResetService.java     18 Apr 
2005 17:06:37 -0000      1.10
+++ framework/src/java/org/apache/tapestry/engine/ResetService.java     10 Aug 
2005 05:51:46 -0000
@@ -62,7 +62,7 @@
         parameters.put(ServiceConstants.SERVICE, Tapestry.RESET_SERVICE);
         parameters.put(ServiceConstants.PAGE, cycle.getPage().getPageName());
 
-        return _linkFactory.constructLink(cycle, parameters, true);
+        return _linkFactory.constructLink(cycle, parameters, true, null, 0);
     }
 
     public String getName()
Index: framework/src/java/org/apache/tapestry/engine/RestartService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/RestartService.java,v
retrieving revision 1.14
diff -u -r1.14 RestartService.java
--- framework/src/java/org/apache/tapestry/engine/RestartService.java   21 Jul 
2005 19:17:39 -0000      1.14
+++ framework/src/java/org/apache/tapestry/engine/RestartService.java   10 Aug 
2005 05:51:46 -0000
@@ -67,7 +67,7 @@
 
         parameters.put(ServiceConstants.SERVICE, Tapestry.RESTART_SERVICE);
 
-        return _linkFactory.constructLink(cycle, parameters, true);
+        return _linkFactory.constructLink(cycle, parameters, true, null, 0);
     }
 
     public void service(IRequestCycle cycle) throws IOException
Index: 
framework/src/java/org/apache/tapestry/engine/encoders/DirectServiceEncoder.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/java/org/apache/tapestry/engine/encoders/DirectServiceEncoder.java,v
retrieving revision 1.2
diff -u -r1.2 DirectServiceEncoder.java
--- 
framework/src/java/org/apache/tapestry/engine/encoders/DirectServiceEncoder.java
    19 Apr 2005 02:25:48 -0000      1.2
+++ 
framework/src/java/org/apache/tapestry/engine/encoders/DirectServiceEncoder.java
    10 Aug 2005 05:51:46 -0000
@@ -60,7 +60,6 @@
         buffer.append(stateful != null ? _statefulExtension : 
_statelessExtension);
 
         encoding.setServletPath(buffer.toString());
-
         encoding.setParameterValue(ServiceConstants.SERVICE, null);
         encoding.setParameterValue(ServiceConstants.PAGE, null);
         encoding.setParameterValue(ServiceConstants.SESSION, null);
Index: framework/src/java/org/apache/tapestry/services/LinkFactory.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/java/org/apache/tapestry/services/LinkFactory.java,v
retrieving revision 1.6
diff -u -r1.6 LinkFactory.java
--- framework/src/java/org/apache/tapestry/services/LinkFactory.java    18 Apr 
2005 17:06:38 -0000      1.6
+++ framework/src/java/org/apache/tapestry/services/LinkFactory.java    10 Aug 
2005 05:51:47 -0000
@@ -44,7 +44,8 @@
      *            If false, the session encoding should not occur. The latter 
case is useful for
      *            services that will absolutely not need any access to 
user-specific state.
      */
-    public ILink constructLink(IRequestCycle cycle, Map parameters, boolean 
stateful);
+    public ILink constructLink(IRequestCycle cycle, Map parameters,
+            boolean stateful, String scheme, int port);
 
     /**
      * A secondary function of the service is to convert encoded (aka 
"squeezed") listener
Index: framework/src/java/org/apache/tapestry/services/impl/LinkFactoryImpl.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/java/org/apache/tapestry/services/impl/LinkFactoryImpl.java,v
retrieving revision 1.11
diff -u -r1.11 LinkFactoryImpl.java
--- framework/src/java/org/apache/tapestry/services/impl/LinkFactoryImpl.java   
18 Apr 2005 17:06:38 -0000      1.11
+++ framework/src/java/org/apache/tapestry/services/impl/LinkFactoryImpl.java   
10 Aug 2005 05:51:47 -0000
@@ -95,7 +95,7 @@
 
     }
 
-    public ILink constructLink(IRequestCycle cycle, Map parameters, boolean 
stateful)
+    public ILink constructLink(IRequestCycle cycle, Map parameters, boolean 
stateful, String scheme, int port)
     {
         Defense.notNull(cycle, "cycle");
         Defense.notNull(parameters, "parameters");
@@ -115,7 +115,7 @@
         String fullServletPath = _contextPath + 
serviceEncoding.getServletPath();
 
         return new EngineServiceLink(cycle, fullServletPath, 
engine.getOutputEncoding(), _codec,
-                _request, parameters, stateful);
+                _request, parameters, stateful, scheme, port);
     }
 
     public ServiceEncoder[] getServiceEncoders()
Index: framework/src/test/org/apache/tapestry/engine/ServiceTestCase.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/test/org/apache/tapestry/engine/ServiceTestCase.java,v
retrieving revision 1.6
diff -u -r1.6 ServiceTestCase.java
--- framework/src/test/org/apache/tapestry/engine/ServiceTestCase.java  18 Apr 
2005 17:07:51 -0000      1.6
+++ framework/src/test/org/apache/tapestry/engine/ServiceTestCase.java  10 Aug 
2005 05:51:48 -0000
@@ -140,7 +140,7 @@
         MockControl control = newControl(LinkFactory.class);
         LinkFactory lf = (LinkFactory) control.getMock();
 
-        lf.constructLink(cycle, parameters, stateful);
+        lf.constructLink(cycle, parameters, stateful, null, 0);
 
         control.setReturnValue(link);
 
Index: framework/src/test/org/apache/tapestry/engine/TestActionService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/test/org/apache/tapestry/engine/TestActionService.java,v
retrieving revision 1.6
diff -u -r1.6 TestActionService.java
--- framework/src/test/org/apache/tapestry/engine/TestActionService.java        
18 Apr 2005 17:07:51 -0000      1.6
+++ framework/src/test/org/apache/tapestry/engine/TestActionService.java        
10 Aug 2005 05:51:48 -0000
@@ -77,7 +77,7 @@
         MockControl lfc = newControl(LinkFactory.class);
         LinkFactory lf = (LinkFactory) lfc.getMock();
 
-        lf.constructLink(cycle, parameters, true);
+        lf.constructLink(cycle, parameters, true, null, 0);
         lfc.setReturnValue(link);
 
         replayControls();
@@ -129,7 +129,7 @@
         MockControl lfc = newControl(LinkFactory.class);
         LinkFactory lf = (LinkFactory) lfc.getMock();
 
-        lf.constructLink(cycle, parameters, true);
+        lf.constructLink(cycle, parameters, true, null, 0);
         lfc.setReturnValue(link);
 
         replayControls();
Index: framework/src/test/org/apache/tapestry/engine/TestDirectService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/test/org/apache/tapestry/engine/TestDirectService.java,v
retrieving revision 1.7
diff -u -r1.7 TestDirectService.java
--- framework/src/test/org/apache/tapestry/engine/TestDirectService.java        
18 Apr 2005 17:07:51 -0000      1.7
+++ framework/src/test/org/apache/tapestry/engine/TestDirectService.java        
10 Aug 2005 05:51:48 -0000
@@ -77,7 +77,7 @@
 
         ILink link = newLink();
 
-        lf.constructLink(cycle, parameters, true);
+        lf.constructLink(cycle, parameters, true, null, 0);
         lfc.setReturnValue(link);
 
         replayControls();
@@ -128,7 +128,7 @@
 
         ILink link = newLink();
 
-        lf.constructLink(cycle, parameters, true);
+        lf.constructLink(cycle, parameters, true, null, 0);
         lfc.setReturnValue(link);
 
         replayControls();
@@ -178,7 +178,7 @@
 
         ILink link = newLink();
 
-        lf.constructLink(cycle, parameters, true);
+        lf.constructLink(cycle, parameters, true, null, 0);
         lfc.setReturnValue(link);
 
         replayControls();
Index: framework/src/test/org/apache/tapestry/engine/TestExternalService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/test/org/apache/tapestry/engine/TestExternalService.java,v
retrieving revision 1.5
diff -u -r1.5 TestExternalService.java
--- framework/src/test/org/apache/tapestry/engine/TestExternalService.java      
18 Apr 2005 17:07:51 -0000      1.5
+++ framework/src/test/org/apache/tapestry/engine/TestExternalService.java      
10 Aug 2005 05:51:48 -0000
@@ -63,7 +63,7 @@
 
         IRequestCycle cycle = (IRequestCycle) newMock(IRequestCycle.class);
 
-        lf.constructLink(cycle, parameters, true);
+        lf.constructLink(cycle, parameters, true, null, 0);
         lfc.setReturnValue(link);
 
         replayControls();
Index: framework/src/test/org/apache/tapestry/engine/TestPageService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/test/org/apache/tapestry/engine/TestPageService.java,v
retrieving revision 1.4
diff -u -r1.4 TestPageService.java
--- framework/src/test/org/apache/tapestry/engine/TestPageService.java  18 Apr 
2005 17:07:51 -0000      1.4
+++ framework/src/test/org/apache/tapestry/engine/TestPageService.java  10 Aug 
2005 05:51:48 -0000
@@ -43,7 +43,7 @@
 
         IRequestCycle cycle = newRequestCycle();
 
-        lf.constructLink(cycle, parameters, true);
+        lf.constructLink(cycle, parameters, true, null, 0);
         lfc.setReturnValue(link);
 
         replayControls();
Index: framework/src/test/org/apache/tapestry/junit/TestEngineServiceLink.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/test/org/apache/tapestry/junit/TestEngineServiceLink.java,v
retrieving revision 1.9
diff -u -r1.9 TestEngineServiceLink.java
--- framework/src/test/org/apache/tapestry/junit/TestEngineServiceLink.java     
18 Apr 2005 17:07:50 -0000      1.9
+++ framework/src/test/org/apache/tapestry/junit/TestEngineServiceLink.java     
10 Aug 2005 05:51:49 -0000
@@ -64,7 +64,7 @@
         control.setReturnValue("/context/servlet?service=myservice;encoded");
 
         EngineServiceLink l = new EngineServiceLink(rc, "/context/servlet", 
ENCODING, _urlCodec,
-                request, buildParameters("myservice", null), true);
+                request, buildParameters("myservice", null), true, null, 0);
 
         replayControls();
 
@@ -86,7 +86,7 @@
 
         EngineServiceLink l = new EngineServiceLink(rc, "/ctx/app", ENCODING, 
_urlCodec, request,
                 buildParameters("foo", new String[]
-                { "godzilla", "frodo" }), false);
+                { "godzilla", "frodo" }), false, null, 0);
 
         replayControls();
 
@@ -105,7 +105,7 @@
         IRequestCycle rc = (IRequestCycle) control.getMock();
 
         EngineServiceLink l = new EngineServiceLink(rc, "/context/servlet", 
ENCODING, _urlCodec,
-                request, buildParameters("myservice", null), true);
+                request, buildParameters("myservice", null), true, null, 0);
 
         rc.encodeURL("/context/servlet");
         control.setReturnValue("/context/servlet;encoded");
@@ -125,7 +125,7 @@
         IRequestCycle rc = (IRequestCycle) newMock(IRequestCycle.class);
 
         EngineServiceLink l = new EngineServiceLink(rc, "/context/servlet", 
ENCODING, _urlCodec,
-                request, buildParameters("myservice", null), false);
+                request, buildParameters("myservice", null), false, null, 0);
 
         replayControls();
 
@@ -140,7 +140,7 @@
         IRequestCycle rc = (IRequestCycle) newMock(IRequestCycle.class);
 
         EngineServiceLink l = new EngineServiceLink(rc, "/context/servlet", 
ENCODING, _urlCodec,
-                request, buildParameters("myservice", null), false);
+                request, buildParameters("myservice", null), false, null, 0);
 
         replayControls();
 
@@ -158,7 +158,7 @@
         WebRequest request = (WebRequest) requestc.getMock();
 
         EngineServiceLink l = new EngineServiceLink(rc, "/ctx/app", ENCODING, 
_urlCodec, request,
-                buildParameters("myservice", null), false);
+                buildParameters("myservice", null), false, null, 0);
 
         request.getScheme();
         requestc.setReturnValue("HTTP");
@@ -185,7 +185,7 @@
         WebRequest request = (WebRequest) requestc.getMock();
 
         EngineServiceLink l = new EngineServiceLink(rc, "/ctx/app", ENCODING, 
_urlCodec, request,
-                buildParameters("myservice", null), false);
+                buildParameters("myservice", null), false, null, 0);
 
         replayControls();
 
Index: framework/src/test/org/apache/tapestry/services/impl/TestLinkFactory.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/framework/src/test/org/apache/tapestry/services/impl/TestLinkFactory.java,v
retrieving revision 1.6
diff -u -r1.6 TestLinkFactory.java
--- framework/src/test/org/apache/tapestry/services/impl/TestLinkFactory.java   
18 Apr 2005 17:07:51 -0000      1.6
+++ framework/src/test/org/apache/tapestry/services/impl/TestLinkFactory.java   
10 Aug 2005 05:51:50 -0000
@@ -141,7 +141,7 @@
         Map parameters = new HashMap();
         parameters.put(ServiceConstants.SERVICE, "myservice");
 
-        ILink link = lf.constructLink(cycle, parameters, false);
+        ILink link = lf.constructLink(cycle, parameters, false, null, 0);
 
         verifyControls();
 
@@ -183,7 +183,7 @@
         Map parameters = new HashMap();
         parameters.put(ServiceConstants.SERVICE, "myservice");
 
-        ILink link = lf.constructLink(cycle, parameters, true);
+        ILink link = lf.constructLink(cycle, parameters, true, null, 0);
 
         assertEquals("{encoded}", link.getURL());
 
@@ -215,7 +215,7 @@
         Map parameters = new HashMap();
         parameters.put(ServiceConstants.SERVICE, "myservice");
 
-        ILink link = lf.constructLink(cycle, parameters, false);
+        ILink link = lf.constructLink(cycle, parameters, false, null, 0);
 
         verifyControls();
 
@@ -249,7 +249,7 @@
         parameters.put(ServiceConstants.SERVICE, "page");
         parameters.put(ServiceConstants.PAGE, "Barney");
 
-        ILink link = lf.constructLink(cycle, parameters, false);
+        ILink link = lf.constructLink(cycle, parameters, false, null, 0);
 
         verifyControls();
 
@@ -287,7 +287,7 @@
         parameters.put(ServiceConstants.PARAMETER, new Object[]
         { Boolean.TRUE });
 
-        ILink link = lf.constructLink(cycle, parameters, false);
+        ILink link = lf.constructLink(cycle, parameters, false, null, 0);
 
         verifyControls();
 
Index: portlet/src/java/org/apache/tapestry/portlet/PortletHomeService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/portlet/src/java/org/apache/tapestry/portlet/PortletHomeService.java,v
retrieving revision 1.4
diff -u -r1.4 PortletHomeService.java
--- portlet/src/java/org/apache/tapestry/portlet/PortletHomeService.java        
10 May 2005 22:50:57 -0000      1.4
+++ portlet/src/java/org/apache/tapestry/portlet/PortletHomeService.java        
10 Aug 2005 05:51:50 -0000
@@ -61,7 +61,7 @@
 
         parameters.put(ServiceConstants.SERVICE, Tapestry.HOME_SERVICE);
 
-        return _linkFactory.constructLink(cycle, parameters, true);
+        return _linkFactory.constructLink(cycle, parameters, true, null, 0);
     }
 
     public void setLinkFactory(LinkFactory linkFactory)
Index: portlet/src/test/org/apache/tapestry/portlet/TestPortletHomeService.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tapestry/portlet/src/test/org/apache/tapestry/portlet/TestPortletHomeService.java,v
retrieving revision 1.4
diff -u -r1.4 TestPortletHomeService.java
--- portlet/src/test/org/apache/tapestry/portlet/TestPortletHomeService.java    
10 May 2005 22:50:57 -0000      1.4
+++ portlet/src/test/org/apache/tapestry/portlet/TestPortletHomeService.java    
10 Aug 2005 05:51:50 -0000
@@ -125,7 +125,7 @@
         ILink link = (ILink) newMock(ILink.class);
         IRequestCycle cycle = newCycle();
 
-        factory.constructLink(cycle, parameters, true);
+        factory.constructLink(cycle, parameters, true, null, 0);
         factoryc.setReturnValue(link);
 
         replayControls();

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to