File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Preventing  bookmarking of pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Preventing  bookmarking of pages" Watch "Preventing  bookmarking of pages" New topic

Preventing bookmarking of pages

Cindy Jones
Ranch Hand

Joined: Oct 08, 2002
Posts: 66
I have a struts based application. There are some actions defined in my strus-config.xml - these are visible to the user. How do I prevent the user from bookmarking the url. When the user tries to access these links directly I want to display a different page which tells hi that it is not possible. Is there any way I can do this.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

You can set a value in the session on the page the user comes from. Struts calls this a token. On the pages that you don't want bookmarked, check for that value.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Hussein Baghdadi
clojure forum advocate

Joined: Nov 08, 2003
Posts: 3479

I think A filter here makes sense.
I agree. Here's the link:
subject: Preventing bookmarking of pages
It's not a secret anymore!