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?
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.
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.
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.
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
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With