Disable back button in browser

I am implementing an IntranetMailServer using the tiles framework now on the login page i need to disable the back button, i tried it using the javascript but when i implement it on the layout.jsp it is working on every single page but when i tried it on the particular login page it is not working because i have already given the body tag in layout.jsp
my java script is like this

yes you are absolutely right but the thing is that for the security concern i want that after logout if somother person uses the same pc and if he/she presses the back button the he/she will see all the private messages of others so this thing i don't want to happen

ok but will you please tell me how to limit the size of file to be uploaded on the server ?..........

and secondly i am making an intranet mail server so i just need to confirm that when a user sends an attachment to another person so all i have to do is to store that files original name inside the database or else i have to save that file path or the file itself i know it's stupid thing to ask but please tell me as i am 90% sure onto the 1st option