package com.example.unit23.controller;
import com.example.unit23.vo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
//控制类
@RestController
public class StudentController {
@Autowired
protected String msg;
@Autowired
private Student student;
@GetMapping("/test")
public String test(){
return msg;
}
@GetMapping("/student")
public String getStu(){
return student.toString();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
软件框架-实现使用@Component@Data@Configuration@Bean(配置类控制类实体类)等方法实现将配置文件

共91个文件
xml:69个
class:5个
java:5个

需积分: 0 57 浏览量
2023-03-23
21:07:10
上传
评论
收藏 108KB ZIP 举报
1.该程序代码是使用idea2021.12版本编写的,若使用其他软件请对照好配置; 2.这个程序具体的内容我忘了,只知道使用@Component@ConfigurationProperties@Data @Configuration@Bean@RestController@Autowired@GetMapping等方法写的,具体实现的功能就是新建几个.yml和.java文件,实现在.yml文件中配置访问路径(输入信息)通过localhost:8080端口实现在网页上输出; 3.下面写的是这个表需要建的结构和代码段以及运行的结果; 4.这个博文讲的,我已将代码包发布到了我的资源里,有需要的可以直接下载并导入到自己的id里,看看能不能运行;
资源推荐
资源详情
资源评论
























收起资源包目录


































































































































共 91 条
- 1
资源评论


鴻陽不是鸿阳
- 粉丝: 74
- 资源: 22
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


会员权益专享
安全验证
文档复制为VIP权益,开通VIP直接复制
