技术标签: spring boot # Spring+SpringMVC+SpringBoot
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!--包含-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>com.cc.starter</groupId>
<artifactId>hello-spring-boot-start-autoconfigure</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<!-- maven坐标 -->
<groupId>com.cc.starter</groupId>
<artifactId>hello-spring-boot-start-autoconfigure</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<!-- 省略-->
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.cc.starter</groupId>
<artifactId>hello-spring-boot-starter-autoconfigure</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<!--不添加pom.xml会报错-->
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>
<dependencies>
<!--引入spring-boot-starter;所有starter的基本配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
</dependencies>
</project>
package com.cc.starter;
import org.springframework.boot.context.properties.ConfigurationProperties;
//从application.properties加载参数
@ConfigurationProperties(prefix = "cc.hello")
public class HelloProperties {
private String prefix;
private String suffix;
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getSuffix() {
return suffix;
}
public void setSuffix(String suffix) {
this.suffix = suffix;
}
}
package com.cc.starter;
public class HelloService {
HelloProperties helloProperties;
public HelloProperties getHelloProperties() {
return helloProperties;
}
public void setHelloProperties(HelloProperties helloProperties) {
this.helloProperties = helloProperties;
}
public String sayHello(String name){
return helloProperties.getPrefix()+"-" +name +"-"+ helloProperties.getSuffix();
}
}
package com.cc.starter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
//定义配置类
@Configuration
//指明是web应用才生效
//也可以自己指定别的生效条件 @ConditionalOnXXX
@ConditionalOnWebApplication
//使 @ConfigurationProperties注解生效
@EnableConfigurationProperties(HelloProperties.class)
public class HelloServiceAutoConfiguration {
@Autowired
HelloProperties helloProperties;
@Bean
public HelloService helloService(){
HelloService service = new HelloService();
service.setHelloProperties(helloProperties);
return service;
}
}
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.cc.starter.HelloServiceAutoConfiguration
# Auto Configure
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration,\
org.springframework.boot.autoconfigure.aop.AopAutoConfiguration,\
org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration,\
org.springframework.boot.autoconfigure.batch.BatchAutoConfiguration,\
org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration,\
<dependecy>
<groupId>com.cc.starter</groupId>
<artifactId>hello-spring-boot-starter</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependecy>
@Controller
public class HelloController {
@Autowired
HelloService helloService;
@ResponseBody
@RequestMapping("/test")
public String test() {
return helloService.sayHello("cc");
}
}
cc.hello.prefix=a
cc.hello.suffix=b
This example program shows how to use lines_color and the differencesbetween the output of lines_color and lines_gauss using an image in whichsome lines can only be extracted from a color image.dev_update_off ()dev_close_window ()dev_open_window (0,.._halcon中按设置线框的颜色和粗细
点击上方蓝色“Golang来啦”关注我哟加个“星标”,天天 15 分钟,掌握 Go 语言你好,我是小四,你情商高,也可以叫我四哥。什么是 go-cachego-cache 是一个轻量级的基于内存的 K-V 储存组件,内部实现了一个线程安全的 map[string]interface{},适用于单机应用。具备如下功能:线程安全,多 goroutine 并发安全访问;每个 item 可以设置过期时间(..._go-cache 保存
网络层功能概述
电脑密码忘记了,怎么重置密码呢?这个问题也许困扰了我们很多朋友。今天告诉大家一个最简单的方法,新手都能学会,无需重装系统,三招解决!U盘实战:可以到东方联盟论坛下载专版操作系统+老毛挑,制作好U盘引导,把U盘插入电脑。所需工具:东方联盟专版操作系统+引导盘具体方法如下:第一步:设置U盘或光盘优先引导,我们首先进入BIOS。本人利用虚拟机演习(光盘引导),按F2进入BIOS界面,设置引导顺序先。我们找到Boot项,进去后,我们会默认看到Hard Drive ,是硬盘引导的意思。把U盘和光盘引导_电脑密码忘3个最简单的方法
理解一个触摸事件能够从时间和空间双方面考虑。1、触摸事件的时间方面触摸事件的在时间方面,例如以下图所看到的。能够有不同的“按下”、“移动”和“抬起”等阶段,表示触摸是否刚刚開始、是否正在移动或处于精巧状态,以及何时结束,也就是手指何时从屏幕抬起。此外。触摸事件的不同阶段都能够有单点触摸或多点触摸,是否支持多点触摸还要看设备和平台。 触摸事件有两个事件监听器:EventListenerTouch...
ftp 是File Transfer Protocol的缩写,文件传输协议,用于在网络上进行文件传输的一套标准协议,使用客户/服务器模式。它属于网络传输协议的应用层。了解更多ftpsftp 是SSH File Transfer Protocol的缩写,安全文件传输协议;了解更多sftpvsftp 是一个基于GPL发布的类Unix系统上使用的ftp服务器软件,它的全称是Very ..._vsftp和sftp的区别
可通过class和style来设置二者区别是下面文字是转载的别人写的,链接是https://blog.csdn.net/qq_34596739/article/details/79792398因为在开发小程序时,只有部分在做毕业设计时候的前端经验,很多问题都是遇到后才了解到。在制作前端的过程中遇到了修改css样式不起作用的问题。因为代码是从网络上拷贝下来的,最开始如下:{{item.c..._微信小程序 view 右上推荐样式
全局配置文件全局配置文件结构properties属性可在外部配置(db.properties),且可动态替换,亦可在子元素property中配置内部配置:外部配置settings 设置改变mybatis的运行时行为<settings> <setting name="cacheEnabled" value="true"/> <setting name="lazyLoadingEnabled" value="true"/>
前言最近几天比较忙,没有连载文章,今天正好有时间就写写吧,连载的都是基础的漏洞,大神路过留个脚印就可以撤了,哈哈,俗话说不喜勿喷,那咱们就开干!跨站脚本(XSS)原理先看下百度百科对XSS的介绍:跨站脚本攻击(Cross Site Scripting),为不和层叠样式表(Cascading Style Sheets, CSS)的缩写混淆,故将跨站脚本攻击缩写为XSS。恶意攻击者往W..._java 代码扫描反射型xss
================================================DAG的深度优先搜索标记INIT:edge[ ] [ ]邻接矩阵;pre[ ],post[ ],tag置为0;CALL:dfstag(i,n);pre/post:开始/结束时间================================================in
常用功能: 1.列编辑 ALT+鼠标选中 2.代码提示 默认的代码自动完成快捷键是Ctrl+Enter。可以在首选项中的备份与自动完成选项卡选中所有的输入均启用自动完成选项和输入时提示函数参数选项,当然这些都可以按照自己的习惯配置。 3.颜色标记功能 颜色标记还很多情况还是比较方便的,使用方法是选中需要标记的文本,右键选择标记的格式。同样方法也可以清除格式。按Ct
1、首先导入融易汇数据,比如导入000777,中核科技。 2、工具——金融分析。下拉列表中选择SZ000777_leaflet 画线