I have just started learning servlets: As far as i know, we can create servlet in 3 ways:
- By writing a class that extends HttpServlet
- By writing a class that extends GenericServlet
- By directly implementing Servlet interface (is this correct?)
I was trying the 3rd method: but in this, i don't know how to print to a web page. In 1st two examples we used to call print on response object which was obtained by getWriter() method.
So can i print something on a webpage when i use method 3 to create a servlet?