• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Help????????

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am having one button and combo box.combo is filled with database values.if i select the combo value and then click the button then i am putting that selected data in session variable.i am using HttpSession.then i retrieved the data from the session and then displayed in the page.
suppose if i click the browser refresh button the value which is selected recently is keep on adding in session and displayed in the page.actually what i want is if i click the browser refresh button i dont want to add the same value again and again.
if anybody didnt understand this concept can u tell me i will respond it clearly.
Thanks and Regards
Kumaran.S
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Posting an example of your code would make it easier for us to help you. I can think of two or three ways you MIGHT be causing this to happen, but only you have the information to tell us exactly what you are doing...
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is probably happening (and this is without viewing your code), is that you GET the data to your page (or servlet?), and because that data is now in the address bar...
http://localhost:8080/examples/yourPageName.jsp?comboValue=one

When you refresh this page, you are asking for the page again, and you are also sending that selection again. There is no real way around this from the client side.

If you are using a servlet on the server side, you could use response.sendRedirect("/yourPageName.jsp") with no ?comboValue=one. This returns you to the page, and your address bar will only contain yourPageName.jsp -> as if it was your first time there. So if you refresh this page, all you are doing is requesting the plain jsp again, and not in fact, resubmitting anything on the address bar.
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic