You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by dg...@apache.org on 2003/01/30 06:37:16 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html BaseTag.java

dgraham     2003/01/29 21:37:16

  Modified:    src/share/org/apache/struts/taglib/html BaseTag.java
  Log:
  Cleaned up duplicated method calls.
  
  Revision  Changes    Path
  1.12      +12 -8     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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- BaseTag.java	17 Nov 2002 01:48:33 -0000	1.11
  +++ BaseTag.java	30 Jan 2003 05:37:15 -0000	1.12
  @@ -7,7 +7,7 @@
    *
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -81,6 +81,7 @@
    * used to call the ActionServlet.
    *
    * @author Luis Arias <lu...@elysia.com>
  + * @author David Graham
    * @version $Revision$ $Date$
    */
   
  @@ -118,6 +119,9 @@
       public int doStartTag() throws JspException {
           HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
           String serverName = request.getServerName();
  +        String scheme = request.getScheme();
  +        int port = request.getServerPort();
  +        
           StringBuffer buf = new StringBuffer("<base href=\"");
           buf.append(request.getScheme());
           buf.append("://");
  @@ -127,13 +131,13 @@
           }
   
           buf.append(serverName);
  -        if ("http".equals(request.getScheme()) && (80 == request.getServerPort())) {
  +        if ("http".equals(scheme) && (80 == port)) {
               ;
  -        } else if ("https".equals(request.getScheme()) && (443 == request.getServerPort())) {
  +        } else if ("https".equals(scheme) && (443 == port)) {
               ;
           } else {
               buf.append(":");
  -            buf.append(request.getServerPort());
  +            buf.append(port);
           }
           buf.append(request.getRequestURI());
           buf.append("\"");
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org