struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Smith <li...@lombardydrive.com>
Subject Re: Change for BaseTag - don't generate port num if :80
Date Fri, 02 Feb 2001 12:18:42 GMT
I take your point with https, but ftp?  That would only be applicable if 
you were using struts to generate HTML files to be downloaded over ftp.

I think the port should be removed if it is the default port for the 
given scheme, but I don't know how to find a scheme's default port in 
Java without hardcoding it.  The change I posted earlier should at least 
check if the scheme is http, and maybe be extended to include https as 
they are the two most common.

Chris Smith

>>>>>>>>>>>>>>>>>> Original Message
<<<<<<<<<<<<<<<<<<

On 2/2/01, 11:28:52 AM, Michael Westbay <westbay@seaple.icc.ne.jp> wrote 
regarding Re: Change for BaseTag - don't generate port num if :80:


> Smith-san 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());
> > +    }

> But what happens when the scheme is "https"?  Or "ftp"?

> > The change is to avoid generating the port number in the base tag if it
> > is the default port, i.e. avoid generating ":80".

> Wouldn't you still want to create the URL with the default port number 
for
> the different schemes as well?

> --
> Michael Westbay
> Work: Beacon-IT http://www.beacon-it.co.jp/
> Home:           http://www.seaple.icc.ne.jp/~westbay
> Commentary:     http://www.japanesebaseball.com/

Mime
View raw message