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

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

主站蜘蛛池模板: 巴楚县| 济源市| 都昌县| 临桂县| 杭锦旗| 邓州市| 达州市| 武义县| 门头沟区| 民勤县| 白朗县| 内乡县| 察哈| 田林县| 抚远县| 营山县| 永新县| 拉萨市| 济南市| 苍溪县| 静海县| 济宁市| 衡水市| 大邑县| 永和县| 临海市| 伽师县| 腾冲县| 阿拉善盟| 北安市| 如东县| 来安县| 孟州市| 荔浦县| 项城市| 綦江县| 望城县| 中牟县| 英德市| 武鸣县| 交城县|