This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am trying to run an application to test cookies.
Now for some reason it's not displaying form.html located in the application folder "CookyTest" .
It was working fine initially when I did not have it linked to any servlets but now i keep getting "Resource Not Found".
If I read this right, you add a cookie to your response...do a few forwards and read it from the request ?
Well it hasn't been to a browser yet or anything, so nobody put it on your request. So you wont get it if you read it of course..
Instead of forwarding, surf to your first page CookieTest (make it doGet instead of doPost). This will add the cookie to the response and send it to the browser.
Then surf to your CheckCookie page to view your cookie.
Notice that the browser received the cookie from the response of CookieTest, and will send it in the new request to CheckCookie
So CheckCookie will receive a cookie then.
Joined: Nov 05, 2007
I changed the doPost to doGet and now i am getting "HTTP method POST is not supported by this URL" even though i changed the form method to Get in the html file.
Anyway , what i was wondering was when you mentioned about surfing to a different Servlet ie. CheckCookie , did you mean using response.sendRedirect(.....) or is there a different way...?