# SpringBootStudy **Repository Path**: zhang_yuanzhuo/spring-boot-study ## Basic Information - **Project Name**: SpringBootStudy - **Description**: SpringBoot学习案例 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-09 - **Last Updated**: 2021-08-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SpringBootStudy #### 介绍 SpringBoot学习案例 #### 软件架构 软件架构说明 # Getting Started ### Reference Documentation For further reference, please consider the following sections: * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.5.0/maven-plugin/reference/html/) * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.5.0/maven-plugin/reference/html/#build-image) ##依赖热更新 1.File->settings->Build,Execution,Deployment->Compiler->Build project Automatically 2.Ctrl+shift+alt+/ 激活面板 Registry ->compiler.automake.allow.when.app.running ##注解: @ConfigurationProperties 批量注入Bean @Value 单属性注入,需要spEL表达式 ##多环境打包: java -jar 路径 --spring.profiles.active=dev/prod/test ##配置文件生成随机数 ${random.value} ${random.int} ${random.long} ${random.uuid} ${random.int(10)} ${random.int[1024,4096]} ##mysql配置 进入https://dev.mysql.com/downloads/mysql/下载,然后配置环境变量,设置密码为123456 ##开启mybatis驼峰命名 mybatis: configuration: map-underscore-to-camel-case: true ##文件下载 1.ResponseEntity 2.commons.io包下的FileUtil 3.文件名需要中文时,使用URLEncoder.encode("","UTF-8");这个思路去处理 ##打包方式 1.打包形式切换 -> pom.xml -> 输入packaging标签以切换打包方式 2.打包war包时 org.springframework.boot spring-boot-starter-tomcat 3.application主类配置 @ServletComponentScan @SpringBootApplication public class SpringJavaMavenApplication2 extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { return builder.sources(SpringJavaMavenApplication2.class); } public static void main(String[] args) { SpringApplication.run(SpringJavaMavenApplication2.class, args); System.out.println("hello"); } } 4.maven -> package 得到war包 5.下载apache-tomcat -> https://blog.csdn.net/weixin_43873620/article/details/89930803 6.apache-tomcat 8.5.32下webapps下 war包粘贴到这个目录中 7.回到webapps的上一级目录打开bin找到startup.bat双击启动tomcat,如果没有报错,回到webapps的文件下会发现war包被解压生成了一个新的文件 8.去访问 http://localhost:8080/war包生成文件夹的名字/注解上的路径 查看结果 ##redis安装步骤 1.打开 https://github.com/microsoftarchive/redis/releases 找到3.2.100版本号下Redis-x64-3.2.100.zip下载解压到自定义目录,不需要额外配置