Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where's javax.servlet?

Tags:

java

servlets

I have jdk1.6.0_13 installed, but when I try to find a javax.servlet package, or press Ctrl+Space in Eclipse after Servlet I cannot get anything. Where can I download this package, and why isn't it included in standard distribution for developers?

like image 951
egaga Avatar asked May 13 '09 19:05

egaga


People also ask

Where is servlet located?

By default, a servlet application is located at the path <Tomcat-installationdirectory>/webapps/ROOT and the class file would reside in <Tomcat-installationdirectory>/webapps/ROOT/WEB-INF/classes.

Which is javax servlet servlet?

This interface is for developing servlets. A servlet is a body of Java code that is loaded into and runs inside a servlet engine, such as a web server. It receives and responds to requests from clients.

How do I fix javax servlet HTTP does not exist?

If you're using the command console to compile the servlet, then you should include Tomcat's /lib/servlet-api. jar in the compile classpath. If you're using an IDE, then you should integrate Tomcat in the IDE and reference it as target runtime in the project.


1 Answers

javax.servlet is a package that's part of Java EE (Java Enterprise Edition). You've got the JDK for Java SE (Java Standard Edition).

You could use the Java EE SDK for example.

Alternatively simple servlet containers such as Apache Tomcat also come with this API (look for servlet-api.jar).

like image 55
Joachim Sauer Avatar answered Sep 23 '22 11:09

Joachim Sauer