You can’t do ${foo.1}

With beans and Maps, you can use the dot operator, but only if the thing you type after the dot is a legal Java identifer.

This

${musicMap.Ambient}

Note

works

Is the same as this1

${musicMap["Ambient"]}

Note

works

But this

${musicList["1"]}

CANNOT be turned into this

${musicList.1}

Note

NO! NO! NO!

Note

If you wouldn’t use it for a variable name in your Java code, DON’T put it after the dot.

Get Head First Servlets and JSP, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.