aspose file tools*
The moose likes Struts and the fly likes Disable back button in browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic
Author

Disable back button in browser

Neeraj jain
Ranch Hand

Joined: Jun 18, 2013
Posts: 104
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


now please do tell me how to achieve it
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10371
    
    8

I would suggest you take a step back and go through https://www.coderanch.com/how-to/java/InterfaceDesignersRule1 before even thinking of disabling the back button.
Tell us what problem you are trying to solve and we can offer alternative suggestions


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Neeraj jain
Ranch Hand

Joined: Jun 18, 2013
Posts: 104
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
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10371
    
    8

Recommended reading
http://www.coderanch.com/t/365306/Servlets/java/disable-button-browser-session-invalidation
http://www.javaworld.com/javaworld/jw-09-2004/jw-0927-logout.html
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61202
    
  66

Disabling the back button will not achieve any level of security. Be sure to read the links that Maneesh posted.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Neeraj jain
Ranch Hand

Joined: Jun 18, 2013
Posts: 104
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
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10371
    
    8

What you are asking now has got nothing to do with your original question.
Please UseOneThreadPerQuestion
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disable back button in browser