Is spring controller really a Servlet ? I guess the dispatcher class we define in web.xml is a servlet. But the beans we use as a controller are not Servlets.
Can anyone clarify that.
Is spring controller really a Servlet ? I guess the dispatcher class we define in web.xml is a servlet. But the beans we use as a controller are not Servlets.
Can anyone clarify that.
According to the API documentation for Spring 3.0 Controller interface:
The Controller interface is explicitly designed to operate on HttpServletRequest and HttpServletResponse objects, just like an HttpServlet. It does not aim to decouple itself from the Servlet API, in contrast to, for example, WebWork, JSF or Tapestry. Instead, the full power of the Servlet API is available, allowing Controllers to be general-purpose: a Controller is able to not only handle web user interface requests but also to process remoting protocols or to generate reports on demand.
So, while it's not a "Servlet" within your container (such as tomcat) it does provide the same capabilities as a servlet.
Hope that helps.
Thanks for your reply. It was helpful.