• Post Reply Bookmark Topic Watch Topic
  • New Topic

Stop the USER ! !

 
Steven Kors
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would i go about stopping the user from leaving a page that i start them up on? I only want a particular page displayed and i dont want the user to go to anyother page. Is there a way of doing this? I would prefer a programming solution hint =)
Thank you =)
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steven
As far a stopping them from leaving the page altogether - you can't. You can do an onblur and pop up a new window or something but you can't take control of their browser and keep them at your page. It would be like the Ranch not letting someone type google.com into their browser and going their.
Containing them to certain pages within your application is another story. You can just set some sort of session attribute and have every page in your app check it to see what page they should be on. If they are on the wrong page just redirect them to the correct one.
Hope that helps
[ May 13, 2002: Message edited by: Dave Vick ]
 
Steven Kors
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason i have asked is because i have been tasked to create a web page (the easy part) that displays certain data but the PC that will have the page up should not allow the user to go to any other page.
This PC will only display this page and nothing else. I managed to lock the PC (policy editor) so that only the web browser opens but i need to have the page remain where it is. But if the user has access to the address bar thie they can go anywhere they wish, which is not what my boss wants.
Unfortunately my knowledge of JSP/Servlets is limited and i am unable to figure this out.
I was thinking that maybe i could monitor if the session has expired because you are leaving the page and use the response.sendRedirect("mypage.jsp"); as a response to this event.
I am not sure if this would work or even where to start hehe... perhaps you could expands on this idea?
ADDITION: I have been to pages were i am not allowed to leave. Where if i hit the back button or type in the address bar, i and sent back to the same page but i dontknow if this was Windows specific code with regard to the IE browser. I cant seem to find a page that does this now .. Figures i guess when you need to find something you cant lol
Thank you for your time.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately my knowledge of JSP/Servlets is limited and i am unable to figure this out.

This is not a JSP/Servlets issue. What you are trying to do can only be accomplished via client-side mechanisms or browser and OS settings (if at all).
hth,
bear
 
Steven Kors
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you have any suggestions Bear?
=)
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Provide a custom browser with NO navigation abilities, make it full-screeen, set it to come up on login/boot, and lock down system security so it can be circumvented.
Then wait for someone to hack around it
In Windows, the easiest way is probably to hack out some sort of minimal VB app that has the MSIE ActiveX control serving as the browser window.
I presume this is supposed to act as some kind of kiosk, and I'm taking a simplistic approach because unless a page has EXACTLY the same contents on it all the time, it's not REALLY the "same" page - at best it just has the same URL.
Of course if it really WAS immutable, you could just stick a painted image over the monitor
 
Yuriy Fuksenko
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For IE 4 and up you could use javascript and provide handler for onbeforeunload event - at this case you could restrict user from leaving you page. Take a look at msdn, Web Development, Dynamic HTML, reference, window object, events
 
Prashanth menon
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Yuriy Fuksenko:
For IE 4 and up you could use javascript and provide handler for onbeforeunload event - at this case you could restrict user from leaving you page. Take a look at msdn, Web Development, Dynamic HTML, reference, window object, events

This does not anyhow prevent the user from accessing the address bar. The only way to do that I think is to open in a new window using javascripts- window.open() with options that remove the address bar from the browser.
Anyhow the parent window remains there. The easiest way would any how be creating a custom browser. This will not be cumbursome.
Prashanth
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like using tokens , doesn't matter if they use vb-browser, have their javascript disabled etc ...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!