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

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).

主站蜘蛛池模板: 九龙坡区| 贵定县| 鄢陵县| 永仁县| 沂水县| 陇南市| 城固县| 台安县| 克拉玛依市| 英超| 新宾| 平果县| 手游| 苏尼特右旗| 米脂县| 芜湖县| 修水县| 凤翔县| 广平县| 东山县| 台江县| 梓潼县| 塔城市| 故城县| 稷山县| 多伦县| 日土县| 永胜县| 云梦县| 双城市| 舟山市| 扎兰屯市| 四子王旗| 清河县| 宜宾县| 兴仁县| 蕉岭县| 施秉县| 宁远县| 上饶县| 唐河县|