-2

I read Servlet is a Java EE specification and that involves packages javax.servlet , javax.servlet.http.

As a part of implementing the specification, one need to provide a class that defines Servlet interface (in package javax.servlet). So is this job done by Java EE itself through HttpServlet class (in package javax.servlet.http).

So I am confused is Java EE one that created Servlet specification and also provided implementation for that specification.

user3714601
  • 1,156
  • 9
  • 27
sql_dummy
  • 715
  • 8
  • 23

2 Answers2

0

javax.servlet.http.HttpServlet is an abstract class , not an implementation. Java EE does provide any implementation for Servlet.

Servlet containers (like Tomcat, JBoss, GlassFish etc.) also contain the servlet-api.jar else they would not be able to run your web application, and moreover they also contain the implementation of the interfaces that are part of the Servlet API (here).

sql_dummy
  • 715
  • 8
  • 23
-1

There is no default implementation for sure, implementation of servlet is a responsibility of application developer. As already mentioned, you need to extend javax.servlet.http.HttpServlet for this purpose.

And you do not need EE container to make it work, Web container is enough.

user3714601
  • 1,156
  • 9
  • 27