Changeset 36126


Ignore:
Timestamp:
2022-04-04T13:15:06+12:00 (2 years ago)
Author:
kjdon
Message:

check for url is not null - if we have left a servlet definition in, but commented out the mapping, then url will be null

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/greenstone3/ServletConfiguration.java

    r36103 r36126  
    127127        String name = XMLTools.getValue(XMLTools.getNodeFromNamed(map, "servlet-name"));
    128128        String pattern = XMLTools.getValue(XMLTools.getNodeFromNamed(map, "url-pattern"));
    129         url_mappings.put(name, pattern);
     129        url_mappings.put(name, pattern);
    130130
    131131    }
     
    137137        String description = XMLTools.getValue(XMLTools.getNodeFromNamed(servlet, "description"));
    138138        String site = getServletSite(servlet);
    139            
    140139        if (site != null) {
    141140        ArrayList this_site = (ArrayList)site_to_servlet_list_map.get(site);
     
    144143        }
    145144        String url = (String)url_mappings.get(name);
    146         if(url.endsWith("/*")) { // truncate trailing /*, e.g. /library/* becomes /library
     145                if (url != null) { // if its null, there was no mapping for the servlet
     146                  if(url.endsWith("/*")) { // truncate trailing /*, e.g. /library/* becomes /library
    147147            url = url.substring(0, url.length()-2);
    148         }
    149         this_site.add(url);
    150         this.site_to_servlet_list_map.put(site, this_site);
    151         this.servlet_to_site_map.put(url, site);
    152         }
     148                  }
     149                  this_site.add(url);
     150                  this.site_to_servlet_list_map.put(site, this_site);
     151                  this.servlet_to_site_map.put(url, site);
     152                }
     153            }
    153154       
    154155    }
Note: See TracChangeset for help on using the changeset viewer.