You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@apache.org on 2001/02/02 21:14:21 UTC
cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html BaseTag.java
craigmcc 01/02/02 12:14:20
Modified: src/share/org/apache/struts/taglib/html BaseTag.java
Log:
Do not include the port number in the rendered base URL if the port is
the default for the specified scheme (80 for "http", 443 for "https").
Revision Changes Path
1.2 +13 -5 jakarta-struts/src/share/org/apache/struts/taglib/html/BaseTag.java
Index: BaseTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BaseTag.java 2001/01/06 21:50:39 1.1
+++ BaseTag.java 2001/02/02 20:14:18 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseTag.java,v 1.1 2001/01/06 21:50:39 mschachter Exp $
- * $Revision: 1.1 $
- * $Date: 2001/01/06 21:50:39 $
+ * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseTag.java,v 1.2 2001/02/02 20:14:18 craigmcc Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/02/02 20:14:18 $
*
* ====================================================================
*
@@ -80,7 +80,7 @@
* this tag.
*
* @author Luis Arias <lu...@elysia.com>
- * @version $Revision: 1.1 $ $Date: 2001/01/06 21:50:39 $
+ * @version $Revision: 1.2 $ $Date: 2001/02/02 20:14:18 $
*/
public class BaseTag extends TagSupport {
@@ -102,8 +102,16 @@
buf.append(request.getScheme());
buf.append("://");
buf.append(request.getServerName());
- buf.append(":");
- buf.append(request.getServerPort());
+ if ("http".equals(request.getScheme()) &&
+ (80 == request.getServerPort())) {
+ ;
+ } else if ("https".equals(request.getScheme()) &&
+ (443 == request.getServerPort())) {
+ ;
+ } else {
+ buf.append(":");
+ buf.append(request.getServerPort());
+ }
buf.append(request.getRequestURI());
buf.append("\">");
JspWriter out = pageContext.getOut();