This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Ankitt Gupta wrote:but the correct result is displayed after refreshing..On running for the first time it displays a blank
Cookies are a good way to remember data on the client for later, but are not a great way to transfer data to the client.
Remember, cookies are a client-side mechanism. When you "create" a cookie on the response you are actually doing no such thing. You are creating a header on the response that tells the browser to create the cookie when it gets the response.
Joined: Oct 08, 2006
Indeed, hence my HttpSession suggestion.
Only use a cookie if you really know/understand what you're actually doing. Do not choose solutions randomly.
Joined: Feb 19, 2009
Much Appreciated Thanks to Everyone.
I don't know whether it is appropriate to ask here but still....can anyone provide me some article or notes on paths i.e context-path,class path etc