when jsp is called first time its compile and load the .class file in memory.. like a simple java file. first time its found the null value in your request.getAttribute() so we must check the null value first to prevent throwing NPE.
"Vishal", My request that you change your display name to adhere to JavaRanch standards was not a suggestion. Valid display names are mandatory for participation on the Ranch. Please change your display name as instructed prior to your next post.
Be aware that accounts with invalid display names are removed.