Hey Venkatesh,
i would still suggest that it is not a good practice for having so much java code in jsp.
However also see the following points in ur code:
which is why it is printing only a single month:
1.what is the need for this loop
2.
You are creating only one instance of calendar and then using the same in the for loop
check this out:i have made some major changes to your code and this will work:
hth,
cheers
vinny m

Regards,Vinny M.
proud Fan of European Champion CHELSEA FC
"If you don't see the bug where you're looking, perhaps you're looking in the wrong place" -James Gosling