Good catch, Chris. I'm going to slightly generalize this so that it doesn't
generate :443 when the scheme is "https" either.
Craig
Chris Smith wrote:
> ---
> /usr/java/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseTag
> .java Mon Jan 15 12:30:42 2001
> +++
> /home/chriss/struts-build/jakarta-struts/src/share/org/apache/struts/tag
> lib/html/BaseTag.java Thu Feb 1 16:57:34 2001
> @@ -102,8 +102,11 @@
> buf.append(request.getScheme());
> buf.append("://");
> buf.append(request.getServerName());
> - buf.append(":");
> - buf.append(request.getServerPort());
> + if (request.getServerPort() != 80)
> + {
> + buf.append(":");
> + buf.append(request.getServerPort());
> + }
> buf.append(request.getRequestURI());
> buf.append("\">");
> JspWriter out = pageContext.getOut();
>
> This is based on revision 1.1 of BaseTag.java.
>
> The change is to avoid generating the port number in the base tag if it
> is the default port, i.e. avoid generating ":80".
>
> This is to solve problems with session handling. When you start to use
> the base tag, your url contains ":80", but your session remains mapped
> against the non-":80" url.
>
> I hope I've supplied the diff in an appropriate format.
>
> Chris Smith