| Author |
error in request.addCookie(c)
|
tangara goh
Ranch Hand
Joined: Dec 27, 2009
Posts: 125
|
|
Hi, I'm testing out a servlet which will track the user name from a html page.
The servlet is supposed to list the cookie with the user name.
However, when I run the Netbean IDE, it shows me error at the request.addCookie(c);
What part have I done wrongly?
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
it shows me error at the request.addCookie(c)
Posting the error would help a lot.
Check the following : Is there a addCookie method in HttpServletRequest ? If not, where is this method ?
|
[My Blog]
All roads lead to JavaRanch
|
 |
tangara goh
Ranch Hand
Joined: Dec 27, 2009
Posts: 125
|
|
The error appeared in netbean IDE is just red color so you know there's mistake at that line.
And also when I run the html file, it gives me a blank with nothing appear there.
May I know how to create the addCookie method?
|
 |
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
|
posted

0
|
You don't want to *create* the method, you want to know where it actually *is*.
Hint: There's no point in adding a cookie to a *request*--a new cookie would get sent *back* to the client.
|
 |
 |
|
|
subject: error in request.addCookie(c)
|
|
|