I checked page 249 of the Head First book and I notice your code example is mixing up the 2 examples on this page (which makes it not compile at all):
i think Roel ,you check it once again and i am not mixing the two questions
I am asking for the second part of the "be the container.
According to me,
a runtime exception (IllegalStateException) is thrown because you can’t call session.getAttribute after
session.setMaxInactiveInterval(0);
but the explanation in book for the exception is different