• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to allow bookmark of only home page?

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to allow people to bookmark only the home page of my website. How do I block other pages on my website from being bookmarked? Please help with any suggestions!!...
Thanks!
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh come'on. You mean to tell me that you always come into JavaRanch from the Main page and that you NEVER just skip straight to the Saloon???
 
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A bookmark is just a URL sitting in someone's private HTML or XML file. You can't prevent it.
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way = Your entire site has to run thru one dispatcher servlet. That's the only URL so that's all they can bookmark. Somehow (using request properties and session values and stuff like that) you have to do the navigation so the dispatcher can serve up the right content based on context (what the user is doing). An empty context from a bookmark would get them to the home page.
Of course when you do this, none of the pages in your site can have "normal" HREF URL links - they all have to build some sort of POST or whatever to tell the dispatcher what to do.
Then you start worying about things like browser Back and Reload buttons (which can get the dispatcher confused).
Look at something like Apache's Struts to help with this dispatching stuff.
Another way = You can put some sort of "marker" like HTTP session or a cookie, and check for it at the top of every single page. If the marker is not there, then redirect them to the home page. That will not prevent them from having "internal" bookmarks, but will have every bookmark go back to home. Of course, once they're in to the home page and have the "marker", then the bookmarks will probably take them to where they wanted to go.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can run the entire site within a single frame. (I hate frames ) If someone bookmarks a page, they will always bookmark the outer parent frame.
This isn't a perfect solution since poeple can still get to the innet frames to bookmark them.
The 'Front Servlet' would work, but I'm also wary of this solution. The Front Servlet is a design pattern and applying patterns out of context is not a good idea. At the very least you could be adding significant complexity for no real reason.
Dave
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic