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

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

主站蜘蛛池模板: 赞皇县| 壤塘县| 将乐县| 元阳县| 吐鲁番市| 云霄县| 长岛县| 千阳县| 南江县| 方正县| 韶关市| 建瓯市| 庄浪县| 通化市| 江阴市| 鹤壁市| 女性| 锡林郭勒盟| 西峡县| 耿马| 新和县| 西青区| 龙里县| 沽源县| 高雄市| 称多县| 北安市| 秦安县| 长寿区| 富民县| 西充县| 高青县| 南澳县| 百色市| 柞水县| 怀仁县| 沁阳市| 吴江市| 米泉市| 宜州市| 庆城县|