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

Can not retrive value from cookie

 
Ranch Hand
Posts: 826
Eclipse IDE Oracle Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, my first form of the application is


I retrive the value from the field and set it to a new cookie.


And then I disply the value after retriving it in FirstResult.java


But when for the first time the application is run, no value is displayed on the page.
And when I refresh or run the application again the get the previous value from the field.

Why is it so? I have tried all alternatives and have come to the conclusion that for the first time the value of the cookie is not set.
But to over come this confusing state I have used the FirstRequest.java controller servlet.But still I do not get a solution.
Please help.




[ September 23, 2008: Message edited by: Sudipto Shekhar ]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do you expect the Cookie set in the response to turn up in the request to the forwarded destination?

Cookies will only turn up in requests after they have been set in the client browser - this requires that the browser actually get the response.

Bill
 
sudipto shekhar
Ranch Hand
Posts: 826
Eclipse IDE Oracle Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok i get that.
I'll try it out.
Thank you.
 
sudipto shekhar
Ranch Hand
Posts: 826
Eclipse IDE Oracle Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it worked.

As I am rookie to servlets,all your hepls and suggestions are helping me a lot.
Thank you once again.

reply
    Bookmark Topic Watch Topic
  • New Topic