Should welcome files begin with slash or not?-Collection of common programming errors

If you get conflicting information, it is best to check the specification. The Servlet Specification version 3.0 says the following (section 10.10, page 127):

“The welcome file list is an ordered list of partial URLs with no trailing or leading /.”

The “book” you are reading is correct.

Apparently the version of GlassFish you are using is not checking constraint at runtime. Presumably is doing something sensible with the leading slash, though that is beyond the scope of the Servlet spec.