当前位置:网站首页>Summary of knowledge points
Summary of knowledge points
2022-06-26 18:26:00 【[email protected]】
1. A summary of knowledge
1.1 Mysql
Version Description : Better not to use mysql8.0 It is recommended to use mariadb 10 above
Download address : https://mariadb.org/download/?rel=10.6.4&prod=mariadb&os=windows&cpu=x86_64&pkg=msi&mirror=ossplanet
Basic function CRUD operation .
How to connect : Left connection , The right connection , Internal connection
1.2 JDBC
Function and function : java The most direct way to operate a database in .
describe : JDBC High development efficiency ? Low development efficiency
JDBC High operational efficiency ? The fastest way to operate a database is JDBC
1.3 front end
Core knowledge :
1.html
2.javascript JS Learn one
3.CSS beautify
4、Ajax
The content of the front end belongs to a static page .
Dynamic pages : JSP html + java Code tomcat Responsible for parsing .
1.4 Frame description
SpringBoot The core is Spring, Simplified framework development
understand :SpringBoot It's the framework of the framework
SpringMVC idea : It is mainly responsible for realizing front and back-end interaction .
medium : http( unsafe )/https( Security ) Secret key : certificate ( Public key private key ) agreement
TCP/IP agreement (3 Second handshake rule ) The speed is very fast
Commonly used tools : Ajax
Spring frame
The main role : Mainly integrating third-party frameworks , So that the program can be managed in a unified way .
Concept :
1. Inversion of control / Dependency injection IOC/DI
2. Section oriented programming AOP(1-2 year )
2. IDEA Environment configuration
2.1 Prepare the working directory
explain : The code of the third stage of integration is put into the directory cgb2108 in , This directory should not be coupled with other software .
Programmer ethics : 1. No Chinese in the path / Space / Special characters
2. The software directory structure should not be coupled with other software !!!
3. Find a handy text editor EverEdit.exe
2.2 IDEA Environment configuration
Specific steps See information PPT
2.3 maven To configure
2.3.1 Maven Introduce
Maven Project object model (POM), You can manage the construction of a project with a short piece of descriptive information , Project management tool software for reports and documents .
Maven In addition to the ability to build programs , There are also advanced project management tools . because Maven The default build rules of are highly reusable , So often two or three lines Maven Build scripts to build simple projects . because Maven A project oriented approach to , many Apache Jakarta Use... When the project is sent Maven, And the company uses Maven The proportion is growing .
2.3.2 Maven download
2.3.3 Maven working principle
1. User used jar Packages come from local libraries .
2. In the local library jar package From private server image and remote server .
2.3.4 Maven Settings file
Configure local warehouse location
<localRepository>E:/project3/repo</localRepository>
Configure private server image
<mirror>
<id>aliyun</id>
<name>aliyun for maven</name>
<mirrorOf>*</mirrorOf>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
The old version eclipse Configuration of
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>
1.8
</maven.compiler.compilerVersion>
</properties>
</profile>
2.3.5 IDEA Integrate Maven
2.4 SpringBoot Introductory cases
2.4.1 Select mirror address
2.4.2 Edit project configuration
2.4.3 The editor chooses springboot edition
explain :
1. choice springboot edition 2.3.7
2. Check Spring Web
3 SpringBoot Advanced usage
3.1 maven Coordinate description
3.1.1 maven Coordinate action
maven The coordinates of mainly identify the project , And identify Unique identification .
maven During project operation , One to one correspondence with local warehouse .
<!-- Group ID-->
<groupId>com.jt</groupId>
<!-- Project name -->
<artifactId>springboot_demo1</artifactId>
<!-- Version number -->
<version>0.0.1-SNAPSHOT</version>
3.1.2 maven command
clean Empty... In the project target File directory . xxx.class file information
install Package the project
install Detailed instructions :
Pack every time Will be in 2 Locations generate jar Package file .
Location 1: target In the file directory .
Location 2: According to the coordinates , Generate specific in the local warehouse jar Package file , This file can be relied on by other projects .
3.1.3 Packaging type
jar Package file springboot project / Tools API project / Projects of the framework
war Package file dynamic web project JSP type tomcat The server .
pom type ( identifier ) POM Type indicates aggregation engineering Microservice architecture design generally adopts pom type .
3.1.4 About Maven Download instructions
explain : According to the coordinates, you can specify the location in the local warehouse Find the jar Package file
effect : Can be relied on by other projects
3.1.5 maven jar Transitivity of package dependencies
Case description 1: Users only need to introduce specific jar Package file , be maven You can use transitivity of dependencies , Implement other jar Introduction of package file .
Data structure description :
A.jar rely on B.jar, B.jar rely on C.jar If only import A.jar Then it automatically depends on B/C
3.1.5.1 Jar Implementation principle of transitivity
Realization principle :
1. When maven When scanning dependency information , Will find the corresponding... According to the coordinates jar Package file .
2. Then scan the current directory xxx.pom file
3. according to pom Dependencies in the file dependency Find other dependencies again jar package , Until all the jar Until the package dependency is completed .
3.1.5.2 jar Package delivery security issues ( Expanding knowledge )
problem : jar Package files are downloaded from the network , How to ensure that documents are not tampered with ???
3.1.5.3 sha1 Algorithm is introduced
SHA-1( English :Secure Hash Algorithm 1, Chinese name : Secure hash algorithm 1) It's a cryptographic hash function , Designed by the national security agency , And by the National Institute of standards and Technology (NIST) Published as a federal data processing standard (FIPS).SHA-1 You can generate a 160 position (20 byte ) Hash value , Hash values are usually rendered as 40 Hexadecimal Numbers .
3.1.5.4 About hash Basic knowledge
If the data are the same , same hash Algorithm ask hash Is the value the same ?? It must be the same !!!
If the data is different , same hash Algorithm ask hash Is the value the same ?? Could be the same !!!
(hash Collision )
common hash commonly 8 position 16 Base numbers make up
3.1.5.5 working principle
explain : On the original data hash Calculation Get summary information , When getting data use hash Calculation Compare 2 Summary information of , If it is the same, the data is the same , If they are different, the data must be tampered with .
3.2 About project dependencies
3.2.1 About Springboot Version management instructions
explain : spring-boot-dependencies yes SpringBoot After debugging on the official website , Associate all of the jar Packages are defined . Fundamentally solved jar The problem of package version conflict .
explain 2: If you need to introduce other jar Package file , Just add jar Package name is enough .
explain 3: special jar Package file You need to add the version number manually
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
3.3 About build Function of label
explain : When springboot When the project needs to be packaged ,springBoot Medium build Labels will work , take springBoot Print in an executable way jar Package file .
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.7.RELEASE</version>
<configuration>
<mainClass>com.jt.SpringbootDemo1Application</mainClass>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
without build label Then the project startup error is as follows .
3.4 About the configuration file description
3.4.1 Default profile name
springboot project The name of the default profile application.properties The name is generally fixed , Will not be changed at will .
3.4.2 properties Syntax description
Syntax description :
1. data structure key=value
2. value There should be no blank space before and after the
3. properties file The program reads by default ISO-8859-1 Coding structure Chinese must be garbled .
4. pro In file key The name of cannot be reused .
3.4.3 YML Syntax description
Syntax description :
1. data structure key:( Space )value
2. key Keywords have a hierarchical indentation effect , Note that the indentation .
3. YML The default file is UTF-8 Coding format So friendly to Chinese .
4. value There should be no extra space in the
5. YML In file key The prefix of can be reused . Attention hierarchy 3.5 Dynamically assign values to attributes
3.5.1 Introductory cases
package com.jt.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
// Note that : @RestController = @Controller + @ResponseBody
// effect : 1. @Controller Give the current class to Spring Container management
// 2. @ResponseBody When the front and back end interact , Convert the object returned by the back-end server into JSON
// Front and back end interactive media http agreement The transmitted data is a string
// JSON: A specially formatted string
@RestController
public class HelloController {
private String name = " Li Si ";
/**
* URL: http://localhost:8080/getName
* Return value : Variable name attribute
*/
@RequestMapping("/getName") // It is recommended that you write an absolute path
public String getName(){
return name;
}
}
3.5.2 Requirement specification
Due to the following code Write the name directly into the variable , If it needs to be modified later , You need to change the source code . Inconvenient for later maintenance .
Solution : Dynamically assign values to attributes .
3.5.3 edit YML file
3.5.4 edit HelloController
@RestController
public class HelloController {
// effect : from Spring Get data from container , You need to specify the key
// $ springel spel expression
@Value("${cgbname}")
private String name; // = " Wang Wu ";
/**
* URL: http://localhost:8080/getName
* Return value : Variable name attribute
*/
@RequestMapping("/getName") // It is recommended that you write an absolute path
public String getName(){
return name;
}
}
3.6 utilize pro The file assigns values to properties
3.6.1 Business description
problem : YML File is Spring Core profile for . The main purpose is to integrate the third-party framework . If you will
A large amount of business data is written to YML In file , It will lead to code structure confusion .
Solution : have access to pro File realizes business data processing .3.6.2 edit pro The configuration file
cgbname2= Monkey King
3.6.3 Implement data assignment
package com.jt.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
// Note that : @RestController = @Controller + @ResponseBody
// effect : 1. @Controller Give the current class to Spring Container management
// 2. @ResponseBody When the front and back end interact , Convert the object returned by the back-end server into JSON
// Front and back end interactive media http agreement The transmitted data is a string
// JSON: A specially formatted string
@RestController
// Loads the specified configuration file , And set the character set encoding format
@PropertySource(value = "classpath:/name.properties",encoding = "UTF-8")
public class HelloController {
// effect : from Spring Get data from container , You need to specify the key
// $ springel spel expression
@Value("${cgbname}")
private String name; // = " Wang Wu ";
@Value("${cgbname2}") // The attribute is pro In file , Must ask for spring Container loading pro file
private String name2;
/**
* URL: http://localhost:8080/getName
* Return value : Variable name attribute
*/
@RequestMapping("/getName") // It is recommended that you write an absolute path
public String getName(){
return name+"|"+name2;
}
}
4.1 About maven Project loading problem
Sometimes it is possible to create projects No maven , Right click to load .
4.2 Spring How does the container understand
4.2.1 About IOC Explanation
IOC: Inversion of control
Specific meaning : Give the right to create an object to Spring Container management .
reason : If you manage objects yourself , The phenomenon of high coupling is inevitable . It's not easy to expand
Containers : Is a data structure type Map<K,V> aggregate
KEY: The first letter of a class is lowercase
Value: Spring Object created for the current class .
As long as the program starts successfully , be Map Collection ( Containers ), It contains all the IOC The object of Management
Mission statement
vue Scaffold installation
Video name VUE Installation process of backstage scaffold Use after a week We will give you a complete project in class
Virtual machine installation
VMware Configuration instructions About class hour 15 Start using in about days
SpringBoot Out of the box principle ( Interview questions )
SpringBoot Out of the box principle
SpringMVC Calling process
版权声明
本文为[[email protected]@yxg]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261820089148.html
边栏推荐
- DVD-数字通用光盘
- Publish message publishers and subscribe message subscribers of ROS
- Regular match same character
- sql中的几种删除操作
- redis 基础知识
- Connected to surface test questions
- Handwritten promise all
- sqlite数据库的系统表sqlite_master
- Get and set settings in 26class
- Boyun, standing at the forefront of China's container industry
猜你喜欢

Solve the problem that each letter occupies a space in pycharm

Row lock analysis and deadlock

SSO微服务工程中用户行为日志的记录

CD-CompactDisk

Tag dynamic programming - preliminary knowledge for question brushing -2 0-1 knapsack theory foundation and two-dimensional array solution template

Crawl Douban to read top250 and import it into SqList database (or excel table)

限流设计及实现

LeetCode 128最长连续序列

Idea collection code, quickly open favorites collection window

RSA encryption and decryption details
随机推荐
Redis单点登陆系统+投票系统
博云,站在中国容器潮头
vuex中利用缓存解决刷新state数据丢失问题
知识点总结
Handwritten numeral recognition based on tensorflow
Li Kou daily question - day 28 -566 Reshape matrix
刻录光盘的程序步骤
Map and list < map > transfer to corresponding objects
Which securities company is better for a novice to open a stock trading account? How is it safer to speculate in stocks??
Enter n integers and output the number of occurrences greater than or equal to half the length of the array
Binary search-1
Usage and difference between ros:: spinonce() and ros:: spin()
Vscode 基础必备 常用插件
Using recursion to find all gray codes with n bits
分页查询、JOIN关联查询优化
字符串String转换为jsonArray并解析
微信小程序 uniapp 左滑 删除 带删除icon
Comparing the size relationship between two objects turns out to be so fancy
Determine whether a sequence is a stack pop-up sequence
Example of using QPushButton style (and method of adding drop-down menu to button SetMenu)