This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
No announcement yet.
Is spring controller really a Servlet ?Page Title Module
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.