4.0.0com.demohello-spring-boot-starter-autoconfigure0.0.1-SNAPSHOThello-spring-boot-starter-autoconfigureDemo project for Spring Bootorg.springframework.bootspring-boot-starter-parent2.4.01.8org.springframework.bootspring-boot-starter
4.0.0com.exampleboot-09-customer-starter-test0.0.1-SNAPSHOTboot-09-customer-starter-testDemo project for Spring Boot1.8UTF-8UTF-82.4.1org.springframework.bootspring-boot-starter-weborg.springframework.bootspring-boot-starter-testtestcom.demohello-spring-boot-starter1.0-SNAPSHOTorg.springframework.bootspring-boot-dependencies${spring-boot.version}pomimportorg.apache.maven.pluginsmaven-compiler-plugin3.8.11.81.8UTF-8org.springframework.bootspring-boot-maven-plugin2.4.1com.example.boot.Boot09CustomerStarterTestApplicationrepackagerepackage
添加配置文件 application.properties
# 应用名称
spring.application.name=boot-09-customer-starter-test
# 应用服务 WEB 访问端口
server.port=8080
bingge.hello.prefix=江西
bingge.hello.suffix=你好
添加 HelloController
package com.example.boot.controller;
import com.demo.hello.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author chenjianbing
* @create 2021-09-19 20:26
*/
@RestController
public class HelloController {
@Autowired
HelloService helloService;
@GetMapping("hello")
public String sayHello(){
String s = helloService.sayHello("张三");
return s;
}
}
spring JMS对于异步消息处理基本上只需配置下就能进行高效的处理。其核心就是消息侦听器容器,常用的类就是DefaultMessageListenerContainer。该容器可配置侦听器的并发数量,以及配合MessageListenerAdapter使用消息驱动POJO进行消息处理。且消息驱动POJO是放入TaskExecutor中进行处理,进一步提高性能,减少侦听器的阻塞。具体配置如下:
ZIP文件的解压缩实质上就是从输入流中读取数据。Java.util.zip包提供了类ZipInputStream来读取ZIP文件,下面的代码段创建了一个输入流来读取ZIP格式的文件;
ZipInputStream in = new ZipInputStream(new FileInputStream(zipFileName));
&n
Spring可以通过注解@Transactional来为业务逻辑层的方法(调用DAO完成持久化动作)添加事务能力,如下是@Transactional注解的定义:
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version
使用nginx lua已经两三个月了,项目接开发完毕了,这几天准备上线并且跟高德地图对接。回顾下来lua在项目中占得必中还是比较大的,跟PHP的占比差不多持平了,因此在开发中遇到一些问题备忘一下 1:content_by_lua中代码容量有限制,一般不要写太多代码,正常编写代码一般在100行左右(具体容量没有细心测哈哈,在4kb左右),如果超出了则重启nginx的时候会报 too long pa
import java.util.Stack;
public class ReverseStackRecursive {
/**
* Q 66.颠倒栈。
* 题目:用递归颠倒一个栈。例如输入栈{1,2,3,4,5},1在栈顶。
* 颠倒之后的栈为{5,4,3,2,1},5处在栈顶。
*1. Pop the top element
*2. Revers
仅作笔记使用
public class VectorQueue {
private final Vector<VectorItem> queue;
private class VectorItem {
private final Object item;
private final int quantity;
public VectorI