Spring
codingstyle
Jump for the sun , at least you land on the moon.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
一文搞彻底搞懂 Spring FactoryBean
本文我们讲探讨Spring 框架中的 org.springframework.beans.factory.FacotryBean<T> 接口,接口定义如下:public interface FactoryBean<T> { T getObject() throws Exception; Class<T> getObjectType(); boolean isSingleton();}FactoryBean 是一个在一个类里封装如何构建一个对象的模式,他原创 2020-08-13 09:38:37 · 438 阅读 · 0 评论 -
Fixing java.net Local host name unknown error on Mac OS X
As some of you might know, I am a big fan of modular software (functional modules). So I love OSGi. Snofyre is built on OSGi and Spring DM. Anyways, since I am in the process of rewriting Snofyre, I转载 2014-07-08 15:47:44 · 2991 阅读 · 1 评论 -
Spring Boot 2.0 从入门到精通-Profiles
Spring Boot 利用Profile 区分项目中不同环境读取不同的配置文件和代码,最常见的比如:开发和生产环境连接不同数据库。本文以开发环境连接H2,生产连接mysql 为例讲解。阅读本文前最好阅读此文 点击打开链接。在resources目录下添加application-dev.properties,内容如下#h2spring.datasource.url=jdbc:h2:file:~/t...原创 2018-03-15 14:11:18 · 957 阅读 · 0 评论 -
Spring Boot 2.0 从入门到精通-Secuirty
如果把Spring Security依赖添加到 pom.xml 中,Spring Boot 会自动为web 应用启用安全保护,默认会初始化一个用户,用户名为:user,密码会随机生成一个字符串,在项目启动时查看启动日志会发现如下内容(日志级别要设置为Info):Using generated security password: 78fa095d-3f4c-48b1-ad50-e24c31d5cf...原创 2018-03-16 17:06:56 · 3771 阅读 · 0 评论 -
Spring Boot 2.0 从入门到精通-QuickStart-1
Spring Boot 简介Spring Boot 可以简单地创建基于Spring、可单独运行、并可部署到生成环境的应用程序,它默认集成了很多第三方代码库,使我们很简单的就可以使用,而且使用起来会感觉到Spring 相关的配置也很少。我们使用Spring Boot 可以创建使用 java -jar 运行或者传统的基于war 包部署的Java 应用程序。Spring Boot 主要目标:提高基于Sp...原创 2018-03-13 13:00:51 · 1330 阅读 · 0 评论 -
Spring Boot 2.0 从入门到精通-thymeleaf集成
看本文之前,最好先阅读下此文 Spring Boot 2.0 从入门到精通-QuickStart-1本文主要目标是在Spring Boot 项目中如何引入thymeleaf 以及bootstrap 来渲染出一个用户列表,文章中不涉及 thymeleaf 和 bootstrap 的详细细节,如感兴趣请见官网:http://www.thymeleaf.org ,https://getbootstra...原创 2018-03-14 11:14:00 · 1532 阅读 · 0 评论 -
Spring Boot 2.0 从入门到精通-数据库连接
数据库连接配置Spring Boot 可以自动配置多种嵌入式数据库,如H2、HSQL、Derby,集成时不需要配置连接URL,只需要引入依赖包即可,现在我们拿H2为例讲解在pom.xml 添加H2 配置<dependency> <groupId>com.h2database</groupId> <artifa...原创 2018-03-14 18:01:10 · 1579 阅读 · 1 评论 -
spring 发送邮件时遇到异常org.springframework.mail.MailAuthenticationException
org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFailedException 如果遇到该异常,应该先考虑一下你所配的发送邮箱,有没有对外开放POP3/SMTP服务,据我所知,现在网易已不对外开放...原创 2010-11-11 12:42:31 · 2129 阅读 · 0 评论
分享