Skip to Content

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

iview java set cookie (part II)


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");



response.write("Cookie Set: " );

The error in devStudio is:

"The Constructor "Cookie" is undefined"

The example is from

<a href="">SAP Help Cookie</a>

Is this sample not usable in iviews?

Thanks for answering all my beginner questions so patiently -hs

Former Member replied


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