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

  • 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.
主站蜘蛛池模板: 遂川县| 乐山市| 循化| 临泉县| 行唐县| 望谟县| 贵港市| 石狮市| 峨眉山市| 溆浦县| 垦利县| 海淀区| 当阳市| 湘阴县| 临潭县| 龙游县| 龙陵县| 黔东| 灌南县| 潮安县| 丁青县| 中超| 临汾市| 深州市| 辽宁省| 昌乐县| 凌云县| 平原县| 昆明市| 北海市| 旺苍县| 上饶县| 瑞安市| 侯马市| 蓝田县| 边坝县| 三门县| 祁连县| 随州市| 香河县| 晋宁县|