O'Reilly logo

Head First Servlets and JSP, 2nd Edition by Bert Bates, Bryan Basham, Kathy Sierra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required