spring boot app
一个demo 可以参考一下
AppConfig
@Configuration
@ComponentScan(basePackages = { "org.whm.test" })
@EnableAutoConfiguration
public class AppConfig { public static void main(String[] argss) {
String[] args = { "--spring.config.location=classpath:config/app.yml" };
SpringApplication.run(AppConfig.class, args);
} }
pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
</parent> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency> </dependencies>
app.yml
server:
port: 8099
session-timeout: 30
tomcat.max-threads: 0
tomcat.uri-encoding: UTF-8 spring:
aop:
auto: true
datasource:
url : jdbc:mysql://localhost:3306/newbirds
username : root
password : mymysql
driverClassName : com.mysql.jdbc.Driver
jpa:
database : MYSQL
show-sql : true
hibernate:
ddl-auto : update
naming-strategy : org.hibernate.cfg.ImprovedNamingStrategy
properties:
hibernate:
dialect : org.hibernate.dialect.MySQL5Dialect
启动 : mvn spring-boot:run 或者 直接运行main 方法
spring boot app的更多相关文章
- https Configure a Spring Boot app for HTTPS on Amazon AWS.
参考: https://geocolumbus.github.io/HTTPS-ELB-AWS-Spring-Boot/ 1. 在服务器端配置 证书 域名 映射 2. 导入依赖: <depe ...
- 新建一个新的spring boot项目
简单几步,在Eclipse中创建一个新的spring Boot项目: 1.Eclipse中安装STS插件: Help -> Eclipse Marketplace... Search或选择&qu ...
- Building a RESTful Web Service Using Spring Boot In Eclipse
一.构建restful web service 创建Maven的java web工程,maven的pom文件加入依赖包 创建包hello Greeting.java package hello; pu ...
- Spring boot 内存优化
转自:https://dzone.com/articles/spring-boot-memory-performance It has sometimes been suggested that Sp ...
- Manage Spring Boot Logs with Elasticsearch, Logstash and Kibana
下载地址:https://www.elastic.co/downloads When time comes to deploy a new project, one often overlooked ...
- Spring Boot Memory Performance
The Performance Zone is brought to you in partnership with New Relic. Quickly learn how to use Docke ...
- Spring Boot 分布式Session状态保存Redis
在使用spring boot做负载均衡的时候,多个app之间的session要保持一致,这样负载到不同的app时候,在一个app登录之后,而打到另外一台服务器的时候,session丢失. 常规的解决方 ...
- Spring Boot 负载均衡之外置session状态保存
在使用spring boot做负载均衡的时候,多个app之间的session要保持一致,这样负载到不同的app时候,在一个app登录之后,而打到另外一台服务器的时候,session丢失. 常规的解决方 ...
- [读书笔记] 一、Spring boot项目搭建与配置文件
读书笔记:[JavaEE开发的颠覆者 Spring Boot实战] 作者:汪云飞 从今天开始坚持读书,并记录下此读书笔记. 一,初接触 Spring boot 项目Hello world搭建 1.po ...
随机推荐
- DAY11-MYSQL单表查询
一 单表查询的语法 SELECT 字段1,字段2... FROM 表名 WHERE 条件 GROUP BY field HAVING 筛选 ORDER BY field LIMIT 限制条数 二 关键 ...
- JQuery利用css()修改样式后 hover失效的解决办法
执行完代码后发现写在样式表中的hover效果失效,改了好几遍差点重新写函数,后来发现很简单,是优先级的问题,css()中的内容覆盖了之前的样式 只需要在样式后写!important即可解决! .fil ...
- go语言linux环境配置
linux的设置方法:有4个环境变量需要设置:GOROOT.GOPATH.GOBIN以及PATH.需要设置到某一个profile文件中(~/.bash_profile(单一用户)或/etc/profi ...
- 算法Sedgewick第四版-第1章基础-1.4 Analysis of Algorithms-007按位置,找出数组相关最大值
Given an array a[] of N real numbers, design a linear-time algorithm to find the maximum value of a[ ...
- 51NOD1835 完全图
传送门 分析 令f(i,j)表示i点完全图有j个联通块的方案数. 讨论有i-1个点已经固定了,我们拉出一个代表元素然后讨论它的集合大小然后组合数算一下就可以了. $$ dp(i,j) = \sum_{ ...
- android自定义视图属性(atts.xml,TypedArray)学习
是一个用于存放恢复obtainStyledAttributes(AttributeSet, int[], int, int)或 obtainAttributes(AttributeSet, int[] ...
- javascript 实现类似百度联想输入,自动补全功能
js 实现类似百度联想输入,自动补全功能 方案一: search是搜索框id="search" //点击页面隐藏自动补全提示框 document.onclick = functi ...
- c# 生成xml,xsi不能生成问题
C# 生成xml,xsi不能生成问题 一.简单了解xsi及其其他属性: xsi:schemaLocation用于声明了目标名称空间的模式文档,属性的值由一个URI引用对组成,两个URI之间以空白符分 ...
- c++类 用冒号初始化对象(成员初始化列表)
c++类 用冒号初始化对象(成员初始化列表) 成员初始化的顺序不同于它们在构造函数初始化列表中的顺序,而与它们在类定义中的顺序相同 #include<iostream> ; using n ...
- iOS开发:setNeedsLayOut和setNeedsDisplay区别
1.layoutSubviews方法 1.1 根据苹果官方帮助文档对layoutSubviews方法的解释: 此方法用来重新定义子元素的位置和大小.当子类重写此方法,用来实现UI元素的更精确布局.如果 ...