I just wanted to know whether is it necessary to redeploy a war file when we make some changes in the expanded web application.
I made some changes in the jsp page and it got reflected. But if I make a change in a Java class, compile it and replace it with the old one, the old one still persists. Restarting the web application, even the server does not affect.
I did not try to redeploy the war file but I suppose that is the only solution.
That depends on the server settings. There is usually a setting that allows JSP changes to be picked up automatically (though it's generally turned off in production). Same thing for classes, although reloading a class means to restart the webapp. Restarting the web app should pick up the altered class, unless all that does is to re-unpack the war file. All this is server-specific, so have a look at the documentation.