<% request.setAttribute("decorator", "none"); response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 response.setHeader("Pragma","no-cache"); //HTTP 1.0 response.setDateHeader ("Expires", 0); //prevents caching at the proxy server %>

Accessing properties inside Maps

To access properties inside maps, use the brackets "[]" operators with the desired key. The action class has a map of Book objects in the field books.

To access the book with key "Iliad" in the books map type:

books['Iliad']

on the OGNL console and hit enter. Do it for me

If the key does not have spaces in it, you can access an element in the map, using the dot "." operator.

To access the book with key "Iliad" in the books map type:

books.Iliad

on the OGNL console and hit enter. Do it for me

Note that the object returned is of type Book. If you want to access one of its properties, you can do so using the dot "." operator as you did before.

To access the author property of the book with key "Iliad" in the books map type:

books['Iliad'].author

on the OGNL console and hit enter. Do it for me


[More details]