Announcement Announcement Module
Collapse
No announcement yet.
Is spring controller really a Servlet ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is spring controller really a Servlet ?

    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.

  • #2
    Originally posted by satfaltu View Post
    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.

    Comment


    • #3
      Thanks for your reply. It was helpful.

      Comment

      Working...
      X