有段时间没有写博客,最近入职,准备静下心来好好学习技术,把以前没用的博客删掉,从头开始写博客。本文是介绍springboot如何与springmvc完成合作,而且也只是简单介绍的整合springmvc
首先创建springboot工程,可用idea的自带的生成插件生成
下一步之后可选择自身所需的依赖
接下来我们创建一个controller
package com.example.springboot01.controller;
import com.example.springboot01.entity.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by linjiaming
*/
@RestController
public class HelloWorld {
//读取配置文件中数值
@Value("${boot.name}")