官术网_书友最值得收藏!

The dispatcher servlet

In the first chapter, we were introduced to the dispatcher servlet and saw how to define a dispatcher servlet in web.xml. We learned that every web request first comes to the dispatcher servlet. The dispatcher servlet is the one that decides the controller method that it should dispatch the web request to. In the previous chapter, we created a welcome page that will be shown whenever we enter the URL http://localhost:8080/webstore/ on the browser. Mapping a URL to the appropriate controller method is the primary duty of a dispatcher servlet.

So the dispatcher servlet reads the web request URL and finds the appropriate controller method that can serve that web request and invokes it. This process of mapping a web request to a specific controller method is called request mapping, and the dispatcher servlet is able to do this with the help of the @RequestMapping annotation (org.springframework.web.bind.annotation.RequestMapping).

主站蜘蛛池模板: 利川市| 疏勒县| 孝感市| 武夷山市| 太仆寺旗| 涟水县| 上林县| 兰州市| 安吉县| 黑水县| 晋中市| 寻乌县| 自治县| 商洛市| 佛学| 马公市| 天水市| 通渭县| 萨迦县| 保靖县| 炎陵县| 胶南市| 铁力市| 囊谦县| 浦北县| 二连浩特市| 徐州市| 丹凤县| 吴堡县| 宁都县| 山丹县| 涡阳县| 康乐县| 调兵山市| 固原市| 陵川县| 酒泉市| 禄劝| 鄱阳县| 彰化县| 舒城县|