Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems w/ Tokens and Navigation

 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I see some posts on here talking about Tokenizing Navigation as to avoid double posts etc. This is exactly what I want to do. I need 2 things. What code should I use and where should it go. While I got several versions of this code, I'd like to see some code that is generalized. Also does all the code go into the serlvet... or does some go into the jsp?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you mean by "Tokenizing Navigation" and a search of this forum brings up no prior usage of the term.

So what are you referring to?
[ March 30, 2006: Message edited by: Bear Bibeault ]
 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When navigation is built into a website its possible to hit the back button and be 'out of state'. An example might be if you end up creating an account, end up hitting submit more than once (or hit the back button and resubmit). A way to avoid this is to use the built in token code in order to avoid it. You might have code like this in your servlet in order to avoid double sumbits.


There are two parts to having the token created. The first part is the saveToken(request) part. This goes in your servlet. This creates a token (unique identifier) and puts it in the session. The second part
<html:form ..... >
takes the same token and puts it in the request. Problem is that you need to use this tag in order for this 'tokenizing' to work. It also seems if you have this tag, you also need a form bean. (aka a form associated w/the action). In my case, I don't need it. Its dynamic. A form bean gets in my way. My question is can I use the <html:form ..... > tag w/out using a form bean?
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think so. What is form bean for?
 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quite frankly I don't need it. But it seems when I add the <html:form ... > tag it wants to have a form bean w/it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic