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?
By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
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?
Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
Joined: Nov 02, 2000
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.