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

Defining the API controllers

So far, we have written code to interact with the DB. Next up is to work on the code for the controller. We will have both types of controller—one that returns the view name (Thymeleaf template in our case) with the data for the view populated in the model object, and the other that exposes the RESTful APIs. We will need to add the following dependency to pom.xml:

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
Adding spring-webmvc to the dependency will automatically include spring-core, spring-beans, and spring-context dependencies. So we can remove them from the pom.xml.
主站蜘蛛池模板: 来凤县| 新泰市| 望城县| 明溪县| 唐河县| 龙口市| 登封市| 新丰县| 罗定市| 襄城县| 新安县| 阳谷县| 金溪县| 库尔勒市| 屏东县| 铜川市| 安岳县| 婺源县| 库车县| 合山市| 延寿县| 石家庄市| 凯里市| 普洱| 廉江市| 孟村| 镶黄旗| 灵璧县| 梅河口市| 竹北市| 霍邱县| 南昌县| 谢通门县| 保靖县| 万山特区| 洪江市| 钦州市| 南川市| 霍林郭勒市| 襄樊市| 通榆县|