on 04-25-2006 8:29 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mysterious, indeed.
After deleting and re-pasting the line with "..new.." into DevStudio and re-building, the error disappeared.
Even if the content of the line hasn't changed, it works now. I tried this a dozen times before, always an error.
Sometimes, IT is strange..
Thanks for all your help
regards -hs
HI,
if you have added this
"import com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.Cookie;" import statement
change it to
" import javax.servlet.http.Cookie;"
and Add the jar -> javax.servlet.http.Cookie [servlet.jar]
Then the code works
import javax.servlet.http.Cookie;
import com.sapportals.portal.prt.component.*;
public class Cookie1 extends AbstractPortalComponent
{
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
{
Cookie SapCookie = new Cookie("MyFirstCookie", "1");
SapCookie.setValue("SAPCook");
response.addCookie(SapCookie);
response.write("Cookie Set: " );
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.