As I reported on the struts-users mailing list, netscape 4.7x apparently
treats these
two URLs as distinct:
        http://xxx.yyy.zzz
        http://xxx.yyy.zzz:80
and does not send cookies accepted from one when sending requests to the
other.

This problem appears when testing struts-example, using struts nightly
build
of Feb 12, and Tomcat 3.2.1.

The html taglib adds the port number when creating links, whereas
ActionServlet does not add the port number when doing forwards or
redirects.

The fix that works for me is to change 
org.apache.struts.utils.RequestUtil.absoluteURL
so that it does not put the port number in the URL if it is the default
80.
(I've appended the patch.)

I'm still a mystified about why I haven't seen other reports 
of this problem. Unless other webservers do something similar to
my patch within request.getServerPort(), then I believe the problem
should
have shown up in other servers besides tomcat 3.2.1.  ????


Here's the diff -c:


*** /tmp/RequestUtils.java      Sat Feb 17 09:30:00 2001
--- RequestUtils.java   Sat Feb 17 09:32:00 2001
***************
*** 121,129 ****
  
          try {
              URL url = new URL(request.getScheme(),
!                               request.getServerName(),
!                               request.getServerPort(),
!                               request.getContextPath() + path);
              return (url.toString());
          } catch (MalformedURLException e) {
              return (null);
--- 121,129 ----
  
          try {
              URL url = new URL(request.getScheme(),
!                 request.getServerName(),
!                 request.getServerPort() == 80 ? -1 : request.getServerPort(),
!                 request.getContextPath() + path);
              return (url.toString());
          } catch (MalformedURLException e) {
              return (null);


Gordon

Reply via email to