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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.