您的位置:首页 > 编程语言 > Java开发

spring boot框架

2016-06-08 11:43 381 查看

静态资源文件解析

PathResourceResolver.java

配置项

spring.resources.cache-period=10 配置响应头的Cache-Control: max-age=10

ItellijIdea静态文件修改后动态加载

Build->compile ‘修改的类或者文件’

设置web的contextPath

在spring的boot项目文件中设置

server.context-path=/community

配置mysql连接

spring.datasource.url = jdbc:mysql://192.168.2.9:3306/customer
spring.datasource.username =yqjj
spring.datasource.password = Yqjj_20160801
spring.datasource.driverClassName = com.mysql.jdbc.Driver
# Specify the DBMS
spring.jpa.database = MYSQL
# Show or not log for each sql query
spring.jpa.show-sql = true
# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto = update
# Naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy

# stripped before adding them to the entity manager)
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect


profile管理

profile文件名称格式

“`

application-{name}.properties

启动时添加VM参数

-Dspring.profiles.active={name}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  spring-boo