I have 2 maps and I need to loop through the first map and for each key that I get in the first map I need to find if the key exists in the second map. How do I use map.ContainsKey() and map.get() using JSTL? If the key is found in the second map, I need to display the value.
This actually has less to do with the JSTL than with the EL.
In the EL you cannot call any random method. So a call to a method like containsKey() is not possible. However, you can perform other actions that will yeild similar results.
In the EL, you would do the equivalent of a get() by simply naming the property. So if, for example, you wanted to fetch the mapped value of key 'abc' from a map in scoped variable 'xyz', you would use:
If the key were not hard-coded and was instead in a scoped variable named 'def':
To test whether the key in scoped variable 'def' is defined, you could use: