Transfered database modification logic to a servlet. Also fixed
refresh/back issue.