Welcome to the new Spring.io forums!
If this is your first visit, be sure to check out the
by clicking the link above, and for security reasons, use the
forgot password link to reset your password..
You may have to register before you can post: click the register
link above to proceed. To start viewing messages, select the forum that you want to visit
from the selection below.
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.