摘要: @Validated 注解。需要导入依赖:spring-boot-starter-validation <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validatio 阅读全文
posted @ 2022-06-22 23:50 现在开始JAVA 阅读(26) 评论(0) 推荐(0)
摘要: 第一种(优先): 1 @Component 2 @ConfigurationProperties(prefix = "person") 3 public class Person { 4 5 } 配置yaml文件: 1 person: 2 name: xianzaikaishi 3 age: ${r 阅读全文
posted @ 2022-06-22 23:44 现在开始JAVA 阅读(468) 评论(0) 推荐(0)
摘要: 1 @GetMapping("/selectpage") 2 public Object selectPage(Integer pagenum, Integer pagesize){ 3 EntityWrapper<User> wrapper = new EntityWrapper<User>(); 阅读全文
posted @ 2022-06-18 19:47 现在开始JAVA 阅读(181) 评论(0) 推荐(0)
摘要: 一:操作文件: 1 // 文件操作 2 public static void fileOpe() throws Exception{ 3 // 1:创建文件 4 File file = new File("newfile.txt"); 5 if(!file.exists()){ 6 boolean 阅读全文
posted @ 2022-06-12 18:21 现在开始JAVA 阅读(155) 评论(0) 推荐(0)
摘要: 1:字节流:FileInputStream、FileOutputStreamBufferedInputStream、BufferedOutputStream 2:字符流:FileReader、FileWriter、BufferedReader、BufferedWriter 3:序列化:ObjectO 阅读全文
posted @ 2022-06-12 17:29 现在开始JAVA 阅读(22) 评论(0) 推荐(0)
摘要: 一:字节流(还有缓冲字节流方式): 1 public static void main(String[] args) throws Exception { 2 // 1:输入流 3 FileInputStream fis = new FileInputStream("1.png"); 4 // 2: 阅读全文
posted @ 2022-06-11 17:39 现在开始JAVA 阅读(32) 评论(0) 推荐(0)
摘要: 1:代码: 1 package com.lieyan; 2 3 public class TestStudent { 4 public static void main(String[] args) { 5 6 // getClass方法 7 Student s1 = new Student("aa 阅读全文
posted @ 2021-12-27 22:51 现在开始JAVA 阅读(42) 评论(0) 推荐(0)
摘要: 1 <!-- 导入依赖 dubbo+zookeeper --> 2 <!-- https://mvnrepository.com/artifact/org.apache.dubbo/dubbo-spring-boot-starter --> 3 <dependency> 4 <groupId>org 阅读全文
posted @ 2021-12-14 22:18 现在开始JAVA 阅读(392) 评论(0) 推荐(0)
摘要: 一简单方式: 1 SimpleMailMessage simpleMailMessage = new SimpleMailMessage(); 2 simpleMailMessage.setSubject("java测试邮件"); 3 simpleMailMessage.setText("看看能否通 阅读全文
posted @ 2021-12-06 22:51 现在开始JAVA 阅读(52) 评论(0) 推荐(0)
摘要: 请求: 1 curl -X POST "http://localhost:8080/hello2" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"username\": \"test\"}" 接口: 1 @PostMappi 阅读全文
posted @ 2021-12-02 22:45 现在开始JAVA 阅读(71) 评论(0) 推荐(0)