The top snippet is valid when you are using facelets.
Looks like you are using JSP pages, but documentation examples are created using Facelets, so this is working fine there.
Oh yes, currently I'm not using Facelets yet. Some weeks ago I started my practice with JSF on basis of JSP. Thanks.