File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes servlet requires refresh to show cookie values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet requires refresh to show cookie values" Watch "servlet requires refresh to show cookie values" New topic
Author

servlet requires refresh to show cookie values

tushar panda
Ranch Hand

Joined: Feb 16, 2009
Posts: 133
the servlet shown below requires a refresh to show cookies values.

servlet :


actually is should show retrieved cookie's name and retrieved cookie's value but i require to refresh it to get those values.


Do Right , Fear No Man
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3838

tushar panda wrote:the servlet shown below requires a refresh to show cookies values.
............
but i want it to auto refresh which is not possible because it user doPost method .

I'm not sure I get your problem, but how are you invoking the servlet ?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
tushar panda
Ranch Hand

Joined: Feb 16, 2009
Posts: 133
i have changed the code , please check it .
Vijitha Kumara wrote:I'm not sure I get your problem, but how are you invoking the servlet ?

i am invoking it by a forward method in requestdispatcher.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61417
    
  67

Cookies are a client-side concept. The servlet does not create the cookie, it merely creates headers that tell the browser to create the cookie. Until the headers have been seen by the browser, the cookie does not exist.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet requires refresh to show cookie values