• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

HTML Frames / Applet / Servlet and Session Tracking - Help with Strategy Please

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an HTML page broken up into two frames. In one frame I have an applet with a graphical slider and a submit button. The slider increments an integer (int rating) from 0-100. When the submit button is pressed the applet sends the rating the slider was set at (in String format) as a parameter within a post method to a servlet with the target of the servlet being the other frame on the same HTML page. The servlet reads the parameters from the post request thus getting the rating that was submited. It works beautifuly and is cool because the applet doesn't have to reload everytime the submit button is pressed.
My problem is that if refresh is pressed within the browser, the servlet gets the same post request sent to it again. I need to set something up similar to a tokenizer pattern that will only allow the servlet to do its thing if it is a true new post from the applet and not just a refresh request.
I was thinking to maybe get the current time in the applet when the submit button is pressed store it as a parameter and sending it along with the rating value to the servlet. The servlet could store the time from the applet post in a session of the servlet and then only process the request if the time stored in the session does not equal the parameter assigned from the applet submission.
Do you have any better ideas? How would I get the time from an applet object?
Thanks for your input!
 
David Edelstein
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured it out and it works just as I described.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic