I am developing an application with Spring MVC. In my form I would like the city name-field to be automatically filled in when a zip code is inserted by the user. I therefore parsed a .csv file to objects `ZipCity` (for each zip code an object) and created and array list `zipCityListCh` with those object. I tried to loop through the list on the .jsp page using JavaScript (in order to match the zip code), but the iteration does not work. 

```js
<script type="text/javascript">
  var zip = document.getElementById("field-zipCode");
  zip.addEventListener("blur", zipToCity, false);

  function zipToCity() {
    var field = document.getElementById("field-city");

    for (var i = 0; i < 5; i++) {
      if ("${zipCityAsArray[i].zip==zip.value}") {
        field.value = "${zipCityAsArray[i].city}";
      }
    }

    return true;
  }
</script>
```

It DOES work, though, if I insert a number instead of the variable `i`:

```js
<script type="text/javascript">
  var zip = document.getElementById("field-zipCode");
  zip.addEventListener("blur", zipToCity, false);

  function zipToCity() {
    var field = document.getElementById("field-city");

    for (var i = 0; i < 5; i++) {
      if ("${zipCityAsArray[1].zip==zip.value}") {
        field.value = "${zipCityAsArray[1].city}";
      }
    }

    return true;
  }
</script>
```

It seems as though the variable `i` is not recognized as a number. Here's the controller code:

```js
private ZipCityList zipCityListCh = new ZipCityList("src/main/resources/files/plz.csv");
private ArrayList<ZipCity> zipCityAsArray = zipCityListCh.getZipCityAsArrayList();

@RequestMapping(value = "/createAd", method = RequestMethod.GET)
public ModelAndView createAd(){
  ModelAndView model = new ModelAndView("create-ad");  
  model.addObject("zipCityAsArray",zipCityAsArray );
  model.addObject("adForm", new AdForm());

  return model;
}
```

Why isn't the first snippet working?