cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to import "javax.servlet" packages in Web Dynpro

Former Member
0 Kudos

I am trying to access cookies via a web dynpro using the statement:

TaskBinder.getCurrentTask().getWebContextAdapter().getHttpServletResponse().addCookie(cookie);

But I am unable to add Import statements for javax.servlet*.

Why am I unable to uses these packages? I see the documentation for these under the J2EE v1.3 documentation for the developer studio help.

How can I access cookies from my web dynpro if I cannot use these APIs?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

In your Webdynpro project properties choose Build path and click on Libraries tab. Select "Add External JAR" and select the location of your servlet.jar (Eg : C:\Program Files\SAP\JDT\eclipse\plugins\org.eclipse.tomcat_4.0.6.2\servlet.jar)

Then click on ok and select the check the file in the Import/Export Tab and then say ok. this should include the servlet.jar in your classpath. Then you should be able to use the Cookies class.

regards

ravi

Answers (2)

Answers (2)

Former Member
0 Kudos

Ravi,

Thank you. That is exactly what I needed.

RenaldWittwer
Contributor
0 Kudos

Hi Jeffrey,

as you know Web Dynpro is build for different devices, as browser, PDA, XML Client ...and it is rendering the UI during runtime. How should the software behave if the device is not able to read and write client cookies like a XML client?

I don't know, perhaps your problems have something to do with this.

Best regards

Renald