Missing javax.servlet.http.Cookie class

Go To StackoverFlow.com

1

I haven't been using Java extensively hence forget a lot fundamental things. Basically, I am working with a web-dynamic project (using Eclipse IDE with jdk 1.6), and during the build, I get errors that Cookie class and other web related classes cannot be found. What am I missing?

What Jars files do I need to add (and how)?

thanks

2009-06-16 14:04
by NoName


5

Think you need servlet-api.jar

Try here for any jar files you need http://www.java2s.com/Code/Jar/CatalogJar.htm

2009-06-16 14:09
by PaganSensei


2

Sounds like you are missing servlet-api.jar

You can download it from the Maven repository.

2009-06-16 14:08
by NoName


0

Servlets are only part of the Enterprise Edition, not of the Standard Edition of Java. So you need the Java Enterprise Edition, AKA Java EE.

http://java.sun.com/javaee/

2009-06-16 14:08
by sleske


0

As others have said, you're missing the server api jar.

Having said that, downloading just the servlet api jar and not the server that goes with it means that you can't actually test your code.

In Eclipse, once you're installed a servlet container, such as Sun's Glassfish, Apache Tomcat, or Jetty, you can create a server instance of it so that Eclipse will compile against your server's servlet implementation. Creating a server instance also means that Eclipse's Run on Server command works.

IBM has a slightly outdated guide on Developing Web applications with Tomcat and Eclipse. The entire "Install the Web tools" section can be skipped if you have the Eclipse EE version, as Web Tools are already installed.

2009-06-16 14:23
by Powerlord
Ads