This question befuddles me too...I tried it out in
tomcat and it printed Hello the first time. So, I then printed the session attribute count. So, it prints Hello 1 ! everytime. Does it mean that
1. there already is a session existing since request.getSession(false) doesn't create a session if there isn't one already ?
2. ok, assuming there is a session already, the value of getAttribute would be null becuase otherwise, it would come to the out.println statement. But its going to the setting the attribute else.
But aren't we typecasting a null value to an Integer. How is that not throwing an exception ?
Hopefully, I have made my doubts clear...Could someone help us out ? Thanks.