Thanks for responding. Atlast, it worked fine for me. For some reason, this code didn't work earlier and now it worked. The only difference I could see is that I changed the .jsp page. No other change and the code worked fine.