- Controller注解 用来处理Http请求的 用在类上面 RequestMapping注解 用来配置Url的映射 可在类或者方法上 在类上时,该注解的映射作用在该类的所有方法上 需要两个地址都访问该注解的方法时,可以将地址用逗号隔开,例如: @RequestMapping(value = {"/people","people2"},method =... Controller注解 用来处理Http请求的 用在类上面 RequestMapping注解 用来配置Url的映射 可在类或者方法上 在类上时,该注解的映射作用在该类的所有方法上 需要两个地址都访问该注解的方法时,可以将地址用逗号隔开,例如: @RequestMapping(value = {"/people","people2"},method =...
- 简单的介绍一下SpringBoot的属性配置。 继续上节的博客喔、 配置application.properties文件: #第一种配置方式 #这种配置方式每个属性名都必须写完整 server.port=8081 #配置端口 server.context-path=/hello #配置项目路径123456 可以跑一下看看,这个时候访问项目就路径需要增加/he... 简单的介绍一下SpringBoot的属性配置。 继续上节的博客喔、 配置application.properties文件: #第一种配置方式 #这种配置方式每个属性名都必须写完整 server.port=8081 #配置端口 server.context-path=/hello #配置项目路径123456 可以跑一下看看,这个时候访问项目就路径需要增加/he...
- 第一个SpringBoot应用 在这里我选择的开发工具是IntelliJ IDEA。 在开发前,你需要把环境都装好,Maven,JDK。 按照下面的图片步骤,即可建好一个helloword项目了。 勾选中web选项的web 这三个目录和文件没什么用,你可以删除。 第一次建springBoot项目可能需要时间有点久,别急,在下载jar包呢。... 第一个SpringBoot应用 在这里我选择的开发工具是IntelliJ IDEA。 在开发前,你需要把环境都装好,Maven,JDK。 按照下面的图片步骤,即可建好一个helloword项目了。 勾选中web选项的web 这三个目录和文件没什么用,你可以删除。 第一次建springBoot项目可能需要时间有点久,别急,在下载jar包呢。...
- 对返回数据格式的统一 首先规定一下错误的输出格式: { "code": 1, "msg": "提示", "data": null }12345 data是一个对象 首先定义一个http请求返回的类 package cn.chenhaoxiang.common.entity; /** * Created with IntelliJ IDEA. * Use... 对返回数据格式的统一 首先规定一下错误的输出格式: { "code": 1, "msg": "提示", "data": null }12345 data是一个对象 首先定义一个http请求返回的类 package cn.chenhaoxiang.common.entity; /** * Created with IntelliJ IDEA. * Use...
- 表单验证 项目是上篇文章继续的。 首先说下要干嘛,我们需要拦截People年龄在18岁以下的 首先是在People上的年龄增加一个注解 @Min(value = 18,message = "年龄必须大于18")//message为提示 20180103 private Integer age;12 在这里,我们拦截新增的方法 也就是IndexCont... 表单验证 项目是上篇文章继续的。 首先说下要干嘛,我们需要拦截People年龄在18岁以下的 首先是在People上的年龄增加一个注解 @Min(value = 18,message = "年龄必须大于18")//message为提示 20180103 private Integer age;12 在这里,我们拦截新增的方法 也就是IndexCont...
- 创建spring boot 项目 1.添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <... 创建spring boot 项目 1.添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <...
- 文章目录 一、SpringMVC上传文件二、SpringBoot文件上传1、添加依赖2、配置3、上传单个文件4、上传多个文件5、文件下载 一、SpringMVC上传文件 Spring MVC 文件上传提供了良好的支持 ,而在 Spring Boot 更为简单地配置文件上传 所需的内容。 SpringMVC 中对文件上传做了封装,可... 文章目录 一、SpringMVC上传文件二、SpringBoot文件上传1、添加依赖2、配置3、上传单个文件4、上传多个文件5、文件下载 一、SpringMVC上传文件 Spring MVC 文件上传提供了良好的支持 ,而在 Spring Boot 更为简单地配置文件上传 所需的内容。 SpringMVC 中对文件上传做了封装,可...
- 前言介绍 在实际的开发中,我们需要对netty服务进行更多的操作,包括;获取它的状态信息、启动/停止、对客户端用户强制下线等等,为此我们需要把netty服务加入到web系统中,那么本章节介绍如何将Netty与SpringBoot整合。 Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程。该框... 前言介绍 在实际的开发中,我们需要对netty服务进行更多的操作,包括;获取它的状态信息、启动/停止、对客户端用户强制下线等等,为此我们需要把netty服务加入到web系统中,那么本章节介绍如何将Netty与SpringBoot整合。 Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程。该框...
- 一个低级错误…… 在pom.xml中添加依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> 1234 OK! 一个低级错误…… 在pom.xml中添加依赖: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> 1234 OK!
- 文章目录 一、Liquibase 简介1、主要特点:2、使用方式3、变更集合 二、SpringBoot整合Liquibase1、依赖2、配置2、master.xml3、test.xml4、运行效果 一、Liquibase 简介 LiquiBase(从 2006 年开始投入使用)是一种免费开源的工具,可以实现不同数据库版本之间的... 文章目录 一、Liquibase 简介1、主要特点:2、使用方式3、变更集合 二、SpringBoot整合Liquibase1、依赖2、配置2、master.xml3、test.xml4、运行效果 一、Liquibase 简介 LiquiBase(从 2006 年开始投入使用)是一种免费开源的工具,可以实现不同数据库版本之间的...
- 一、SpringBoot简介 Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can “just run”…Most Spring Boot applications need very little Spring ... 一、SpringBoot简介 Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can “just run”…Most Spring Boot applications need very little Spring ...
- maven导入包: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> <version>2.1.6.RELEASE</version> </dependency> 参数配置: # MailP... maven导入包: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> <version>2.1.6.RELEASE</version> </dependency> 参数配置: # MailP...
- 第 1 节 SpringBoot 入门案例 一、前言 SpringBoot 官网:https://spring.io/projects/spring-boot Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you... 第 1 节 SpringBoot 入门案例 一、前言 SpringBoot 官网:https://spring.io/projects/spring-boot Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you...
- 问题: 正在在做的SpringBoot项目,开发环境是一切OK的,打成war包在Windows系统启动,发现有部分中文乱码。 解决办法: 在启动命令里加上编码: java -Dfile.encoding=utf-8 -jar 1 OK,启动之后的系统没有乱码了,但是新的问题又来了。 问题: DOS窗口中文乱码。 解决办法: 打开cmd... 问题: 正在在做的SpringBoot项目,开发环境是一切OK的,打成war包在Windows系统启动,发现有部分中文乱码。 解决办法: 在启动命令里加上编码: java -Dfile.encoding=utf-8 -jar 1 OK,启动之后的系统没有乱码了,但是新的问题又来了。 问题: DOS窗口中文乱码。 解决办法: 打开cmd...
- 问题 SpringBoot项目连接Redis报错: Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set at redis.clients.jedis.Protocol.processError(Proto... 问题 SpringBoot项目连接Redis报错: Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set at redis.clients.jedis.Protocol.processError(Proto...
上滑加载中
推荐直播
-
HDC深度解读系列 - Serverless与MCP融合创新,构建AI应用全新智能中枢2025/08/20 周三 16:30-18:00
张昆鹏 HCDG北京核心组代表
HDC2025期间,华为云展示了Serverless与MCP融合创新的解决方案,本期访谈直播,由华为云开发者专家(HCDE)兼华为云开发者社区组织HCDG北京核心组代表张鹏先生主持,华为云PaaS服务产品部 Serverless总监Ewen为大家深度解读华为云Serverless与MCP如何融合构建AI应用全新智能中枢
回顾中 -
关于RISC-V生态发展的思考2025/09/02 周二 17:00-18:00
中国科学院计算技术研究所副所长包云岗教授
中科院包云岗老师将在本次直播中,探讨处理器生态的关键要素及其联系,分享过去几年推动RISC-V生态建设实践过程中的经验与教训。
回顾中 -
一键搞定华为云万级资源,3步轻松管理企业成本2025/09/09 周二 15:00-16:00
阿言 华为云交易产品经理
本直播重点介绍如何一键续费万级资源,3步轻松管理成本,帮助提升日常管理效率!
回顾中
热门标签