sgala 01/09/06 09:39:01
Modified: src/java/org/apache/jetspeed/util/template
ContentTemplateLink.java
Log:
Content links were using again the default port always, which breaks cookies
Revision Changes Path
1.4 +10 -4
jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/ContentTemplateLink.java
Index: ContentTemplateLink.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/ContentTemplateLink.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ContentTemplateLink.java 2001/04/03 00:27:32 1.3
+++ ContentTemplateLink.java 2001/09/06 16:39:01 1.4
@@ -64,7 +64,8 @@
* webapp resources.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Rapha�l Luta</a>
- * @version $Id: ContentTemplateLink.java,v 1.3 2001/04/03 00:27:32 raphael Exp $
+ * @author <a href="mailto:[EMAIL PROTECTED]">Santiago Gala</a>
+ * @version $Id: ContentTemplateLink.java,v 1.4 2001/09/06 16:39:01 sgala Exp $
*/
public class ContentTemplateLink
extends DynamicURI
@@ -184,11 +185,16 @@
// we want external URL form so include protocol and server name
if (useExternalForm)
{
- sb.append (getServerScheme()); //http
+ String scheme = getServerScheme();
+ sb.append ( getServerScheme() ); //http
sb.append ("://");
sb.append (getServerName()); //www.foo.com
- sb.append (":");
- sb.append (getServerPort()); //port webserver running on (8080 for TDK)
+ int port = getServerPort();
+ if( ( "http".equals( scheme ) && port != 80 ) ||
+ ( "https".equals( scheme ) && port != 443 ) ) { //only for non-default
ports, to preserve session tracking.
+ sb.append (":");
+ sb.append ( port ); //port webserver running on (8080 for TDK)
+ }
}
//the context for tomcat adds a / so no need to add another
sb.append (contextPath); //the tomcat context
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]