aspose file tools*
The moose likes JSP and the fly likes Controlling the browser appearance using a JSP-html form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Controlling the browser appearance using a JSP-html form" Watch "Controlling the browser appearance using a JSP-html form" New topic
Author

Controlling the browser appearance using a JSP-html form

M Burke
Ranch Hand

Joined: Jun 25, 2004
Posts: 388
When my JSP's and html's are displayed in the browser, I want the back and forward buttons removed from IE. Is there a way to do this? Perhaps a meta tag?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

No, the user retains control of the browser (as it should be).
The best you can do is use Javascript to open a new window without the toolbars.

The folks in the HTML/Javascript forum can give you the exact syntax for this.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
M Burke
Ranch Hand

Joined: Jun 25, 2004
Posts: 388
I do know about window.open(). The problem is, I am using servlets to open JSP's and navigate through the windows, not JavaScript.

Another thought, is it possible to reset the browser history so when they hit the back button they will stay on the current page?

Or, somehow detect the back button event and prevent it from navigating away from the current page?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

There isn't a web developer alive who hasn't, at one time, wanted to disable the back, forward, and refesh buttons.
The specs and all browser implementations have, rightly, refused to take this control from the end user.

The best thing to do is code around the fact they will always be there.
M Burke
Ranch Hand

Joined: Jun 25, 2004
Posts: 388
Gee, I miss the MFC days when we had real power

I have another idea, I will go to the JS forum. Thanks
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Picture trying to browse the web if every nefarious site you 'accidentally' stumbled into had the power to disable your back button.
M Burke
Ranch Hand

Joined: Jun 25, 2004
Posts: 388
Yes, I know. For pub sites it would be a pain. But the app is on a company lan, so it's ok.

I did find an answer. This only works for IE 6x. Use a stub to launch the app.

<html>
<body>

<script type="text/javascript">
window.open('index.jsp', 'new',
"resizable=yes,scrollbars=yes,status=yes");

self.opener=self;
self.opener.close();

</script>

</body>
</html>
[ April 19, 2005: Message edited by: M Burke ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Controlling the browser appearance using a JSP-html form