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

  • Spring 5.0 Projects
  • Nilang Patel
  • 98字
  • 2021-07-02 12:34:57

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.
主站蜘蛛池模板: 韶关市| 房山区| 衡山县| 灌南县| 贵阳市| 宣汉县| 白银市| 本溪| 苏尼特左旗| 鲁甸县| 肃宁县| 酒泉市| 金堂县| 长宁县| 黎川县| 连城县| 沈阳市| 翼城县| 禄丰县| 延安市| 五华县| 铜山县| 孝义市| 云浮市| 西青区| 宣汉县| 宝兴县| 武义县| 蒲城县| 鄄城县| 平山县| 兖州市| 葵青区| 通榆县| 平果县| 民勤县| 吉木萨尔县| 九台市| 太湖县| 鲁山县| 宁乡县|