简体   繁体   中英

Is Dispatcher Servlet a real servlet

I have recently started working on WebMVC and could not clarify the following basic doubt in spite of browsing through multiple forums.

Is Dispatcher Servlet in Spring MVC a real servlet or is it just the xml file where we do the mappings. If its a real servlet then what is its body like and if not then why is it called a servlet

Dispatcher Servlet is a real servlet, there is no doubt about it. That is the reason why we configure all the incoming request to be mapped to that servlet in Spring MVC.

Dispatched servlet is extended from Spring FrameworkServlet, which inturn is extended from HttpServletBean and that is extended from HttpSErvlet.

Check Spring documentation to learn more about the DispatcherServlet:

http://static.springsource.org/spring/docs/3.2.x/javadoc-api/org/springframework/web/servlet/DispatcherServlet.html

Are there any other kind of servlets you know about ? Did you mean HttpServlet/GenericServet ?

Have a look at its Javadoc and source code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM