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

  • 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.
主站蜘蛛池模板: 岢岚县| 沙雅县| 华宁县| 五大连池市| 北流市| 仙桃市| 古蔺县| 内乡县| 嘉兴市| 清河县| 辽阳县| 乌什县| 南平市| 宣化县| 阳春市| 太原市| 江津市| 浦城县| 马山县| 外汇| 左贡县| 仪征市| 自贡市| 玉树县| 枣强县| 和田县| 嘉兴市| 老河口市| 大姚县| 马鞍山市| 福泉市| 沿河| 齐河县| 彭山县| 西吉县| 六安市| 济宁市| 正安县| 大化| 科技| 叙永县|