Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

iview java set cookie (part II)

Hi,

after setting the correct classpath, (see previous question) it seems to be ok.

But now I am getting the following error:

...

import javax.servlet.http.*;

....

Cookie SapCookie = new Cookie("MyFirstCookie", "1");

SapCookie.setValue("SAPCook");

response.addCookie(SapCookie);

response.write("Cookie Set: " );

The error in devStudio is:

"The Constructor "Cookie" is undefined"

The example is from

<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/8cfea3a1e7ff4b953660c5bc437796/frameset.htm">SAP Help Cookie</a>

Is this sample not usable in iviews?

Thanks for answering all my beginner questions so patiently -hs

Former Member replied

Holger,

the error is mysterious. There's definitive such a constructor in the Cookie class (see API documentation).

I can only imagine, that your Cookie object isn't resolved to the correct class. Try to use the full name in your coding:

javax.servlet.http.Cookie SapCookie = new Cookie("MyFirstCookie", "1");

How do your import statements look like?

kr, achim

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question