上一页 1 ··· 47 48 49 50 51 52 53 54 55 ··· 65 下一页
摘要: 代码示例: 启动类: @SpringBootApplication@EnableEurekaServer //自动装配的开关public class EurekaApplication { public static void main(String[] args) { SpringApplicat 阅读全文
posted @ 2023-11-16 17:56 1stzz1 阅读(26) 评论(0) 推荐(0)
摘要: 1. 注册 RestTemplate 对象到 Spring 容器中(Bean 的注入只能放在配置类里,而启动类本身就是配置类) @SpringBootApplicationpublic class OrderServiceApplication { public static void main(S 阅读全文
posted @ 2023-11-16 16:26 1stzz1 阅读(130) 评论(0) 推荐(0)
摘要: @Data → 等于 getter + setter + tostring + hashCode + equals(没有构造方法) @NoArgsConstructor → 无参构造 @AllArgsConstructor → 有参构造 阅读全文
posted @ 2023-11-09 20:15 1stzz1 阅读(21) 评论(0) 推荐(0)
摘要: @Mapper public interface DeptMapper { Dept getById(Integer id); } 问:这段代码是把这个接口注入到spring的bean容器当中去了,但是spring的bean容器不是存的实例化对象吗? 答: 在Spring框架中,将一个类(或接口)注 阅读全文
posted @ 2023-11-09 19:55 1stzz1 阅读(123) 评论(0) 推荐(0)
摘要: SpringBoot 内嵌 Tomcat 工作原理是 将 Tomcat 服务器作为对象运行,并将该对象交给 Spring 容器管理 变更内嵌服务器思想是去除现有服务器,添加全新的服务器 阅读全文
posted @ 2023-11-08 21:38 1stzz1 阅读(35) 评论(0) 推荐(0)
摘要: SpringBoot 工程提供引导类用来启动程序,SpringBoot 工程启动后创建并初始化 Spring 容器 package com.itheima;import org.springframework.boot.SpringApplication;import org.springframe 阅读全文
posted @ 2023-11-08 21:23 1stzz1 阅读(23) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-11-08 20:19 1stzz1 阅读(20) 评论(0) 推荐(0)
摘要: 运行SpringBoot程序通过运行Application程序入口进行 要想保证SpringBoot程序运行起来,主要需要俩文件: 1. pom.xml 2. Application类 @SpringBootApplicationpublic class Springboot01Applicatio 阅读全文
posted @ 2023-11-08 20:16 1stzz1 阅读(26) 评论(0) 推荐(0)
摘要: @Repository 在Dao层类上使用 @Service 在Service层类上使用 @Controller 在Web层类上使用 阅读全文
posted @ 2023-11-03 22:33 1stzz1 阅读(18) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-10-31 21:15 1stzz1 阅读(12) 评论(0) 推荐(0)
上一页 1 ··· 47 48 49 50 51 52 53 54 55 ··· 65 下一页