The first day of learning springboot~
1. springboot is to improve and optimize the disadvantages of spring. Its convention is larger than configuration. It can be used out of the box without code generation or xml file configuration. The property value can be modified to meet the requirements
2. Getting started with springboot
Create a spring boot project in idea
(1) by default, ...
Posted by flhtc on Mon, 04 Nov 2019 23:17:54 +0100
Spring cloud: service gateway zuul API gateway
What is an API gateway:
In a microservice architecture, there are usually multiple service providers. Imagine an e-commerce system, which may have multiple types of services, such as goods, orders, payments, users, etc., and the number of services of each type will also grow and change with the increase of the whole system volume. As the UI sid ...
Posted by Iceman512 on Mon, 04 Nov 2019 10:43:58 +0100
Spring MVC? File upload-day02
Spring MVC file upload)
SpringMVC-day02
Spring MVC file upload
1. Use maven to introduce two more jars' commons-io-2.6. Jar commons-fileupload-1.3.3. Jar based on the Spring jar package and spring MVC jar package.`
2. Spring MVC needs to configure processor mapper, processor adapter, view parser a ...
Posted by rulkster2 on Sun, 03 Nov 2019 02:36:57 +0100
Spring MVC | controller return value and exception handling
Old design
When developing an api, you need to define the data response result of the interface first. Here is a very simple and direct Controller implementation method and response result definition
@RestController
@RequestMapping("/users")
public class UserController {
@Inject
private UserService userService;
@GetRequest("/{user ...
Posted by buceta on Sun, 03 Nov 2019 02:22:34 +0100
The docker k8s cluster deploys tomcat and uses one image to increase the reusability of the image.
Written in the front, k8s clusters have been set up. Please refer to the previous article for specific steps.
Write the Dockerfile file to create a public image. Each time tomcat deploys, it directly uses the image without build ing the image every time.
#At first, I wanted to use tomcat's official image, but I had no choice but to use diban ...
Posted by thankqwerty on Sat, 02 Nov 2019 15:13:20 +0100
Struts2 -- add, delete, modify and query
Using struts to complete adding, deleting, modifying and checkingIdeas: 1. Import related pom dependencies (struts, custom tag library dependency) 2. Import the paginated tag class, z.tld, and complete the configuration of web.xml 3. dao layer to access data 4. The web layer calls the dao layer to return data to the foreground. 5. Configur ...
Posted by GateGuardian on Sat, 02 Nov 2019 08:29:39 +0100
406 when spring MVC converts objects to JSON
Recently, I made such a 406 mistake when I followed the Taotao mall project.This is the code in the Controller
@RequestMapping("/items/{itemId}")
@ResponseBody
public TbItem getItemById(@PathVariable long itemId) {
TbItem item=itemService.findItemById(itemId);
return item;
}
This is the ...
Posted by KRAK_JOE on Fri, 01 Nov 2019 23:41:06 +0100
SSM framework realizes the addition, deletion, modification, query, paging and distribution of projects
1. Create a new project in idea, file - > New - > project. Select Maven, pay attention to jdk1.8, and click Next.
2.k here, Group,Artifactld, click Next.
3. Click finish.
4.ssm_parent1 is the parent class and does not write anything. Then four modules need to be created under ssm_parent1: ...
Posted by bravo81 on Fri, 01 Nov 2019 21:51:09 +0100
Different environment packaging of springboot
Article directory
1. Scene description
2. Solutions
2.1 real code
2.2 code description
2.3 renderings:
2.3.1 program directory
2.3.2 maven directory
1. Scene description
Spring boot + Maven packaging, projects often use different environments to package different configuration files, ...
Posted by fangfang on Thu, 31 Oct 2019 21:18:10 +0100
Mybatis dynamic SQL [if tag, where tag, SQL tag and include tag, foreache tag]
Requirement: query users by gender and name
SQL statement:
Select id, username, birthday, sex, address from 'user ` where sex = 1 and username like'% 3% '
Problems:
There may be only one A.sex and username attribute, and the other is null or empty [use if tag]
B. when the sex/username property is null or empty, the ...
Posted by theonewhotopes on Thu, 31 Oct 2019 15:35:31 +0100