File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bookmarking pages

 
Pranav Sharma
Ranch Hand
Posts: 258
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i read in the earlier posts that I should use tokens to avoid bookmarking of pages.
but in my situation i have action chaining so when i pass from action1 to action2, im guessing the request is reset and the token is invalid.
what is the best way around this.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The token only resets when you call saveToken or resetToken (you'll usually call saveToken). If you never change the token, the same one is kept for an entire session.

You should have no problems with tokens even though you are chaining actions, Mannu.
 
Pranav Sharma
Ranch Hand
Posts: 258
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, Marc(or anybody else) this should work or am I doing something wrong

in action1:
save data from page 1 form
saveToken(request);
forward to action 2

in action 2:
if(isTokenValid(request))
then "get data from db for new page"
resetToken(request);
saveToken(request);
forward to page 2
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IMO it's better like this:

in action1:
if(!isTokenValid(request)) > add ERROR and forward somewhere
save data from page 1 form
saveToken(request);// this does change token, by the way
forward to action 2

in action 2:
"get data from db for new page"
forward to page 2
 
Pranav Sharma
Ranch Hand
Posts: 258
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
din't know what i was thinking, that makes much more sense.
Thanks.
[ September 09, 2005: Message edited by: mannu kapoor ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic