To me the best way is to write a custom tag library for achieving the same. I do not see any other way out.
Additionally, what is that situation which requires such a comparison? Is the chosen data structure[Map] appropriately used, in terms of design -or should it be something else?
Have Fun with Java
little,little.. little by little makes a lot..