The 1% doesn't make use of abstract HttpServlet
class. So they use Servlet
interface without extending HttpServlet
.
Currently in the Java EE API, there's only one other Servlet
which does that: the FacesServlet
which is the core controller behind the Java EE provided MVC framework JavaServer Faces (JSF). JSF enables you to skip all the tedious process and the boilerplate code which is necessary to gather, convert and validate parameters, update the model values and invoke specific action methods.
But at the time of writing this book, the author likely didn't realize that. As of now, JSF certainly doesn't account for only 1%. In theory it's possible to implement Servlet
for other protocols than HTTP, like FTP. This is not provided by the standard Java EE API, but there are some 3rd party "FtpServlet" classes out. And I believe some Portlet APIs also use a non-HttpServlet
class (they just implement Servlet
and don't extend HttpServlet
).
As to the HTTP methods, next to HTTP GET
and POST
there are also HEAD
, PUT
, OPTIONS
, etc. But I think 0.1% is heavily underestimated. The HEAD
is definitely much more often used, think of servletcontainer's own DefaultServlet
(like as Tomcat has). The HEAD
plays an important role in browser cache requests. But when it comes to "homegrown" servlets, then it are indeed GET
and POST
which gets the lone attention.
See also: