上一页 1 2 3 4 5 6 7 8 ··· 24 下一页

2019年1月1日

Spring 梳理 - View - JSON and XML View

摘要: XML example Controller mvc:annotation-driven JSON example Model Controller mvc:annotation-driven 阅读全文

posted @ 2019-01-01 17:05 手握太阳 阅读(173) 评论(0) 推荐(0) 编辑

Spring 梳理 - ContentNegotiatingViewResolver

摘要: <property name="favorPathExtension" value="true"></property> 是否启用扩展名支持,默认是true <property name="favorParameter" value="false"></property> 是否启用参数支持,默认是t 阅读全文

posted @ 2019-01-01 16:48 手握太阳 阅读(1113) 评论(0) 推荐(1) 编辑

Spring 梳理 - 视图解析器 VS 视图(View,ViewResolver)

摘要: DispatcherServlet会加载所有的viewResolver到一个list中,并按照优先级进行解析。 注意:①order中的值越小,优先级越高。 ②而id为viewResolver的viewResolver的优先级是最低的。 阅读全文

posted @ 2019-01-01 15:05 手握太阳 阅读(459) 评论(0) 推荐(0) 编辑

Spring boot 官网学习笔记 - logging

摘要: 为什么要用SLF4J+Logback 替换commons-logging+log4j? 基于slf4j的日志使用 切换日志框架(无意义,slf4j+logback已经是最佳实现) All the supported logging systems can have the logger levels 阅读全文

posted @ 2019-01-01 10:39 手握太阳 阅读(2688) 评论(0) 推荐(0) 编辑

Spring 梳理 - javaConfig在App和webApp中的应用

摘要: package com.dxz.demo.configuration; import org.springframework.context.annotation.Configuration; @Configuration public class TestConfiguration { public TestConfiguration() { System.ou... 阅读全文

posted @ 2019-01-01 09:46 手握太阳 阅读(246) 评论(0) 推荐(0) 编辑

2018年12月31日

Spring boot 梳理 - 在bean中使用命令行参数-自动装配ApplicationArguments

摘要: If you need to access the application arguments that were passed to SpringApplication.run(…​), you can inject a org.springframework.boot.ApplicationAr 阅读全文

posted @ 2018-12-31 10:34 手握太阳 阅读(747) 评论(0) 推荐(0) 编辑

Spring boot 梳理 - SpringApplication

摘要: Web Environment A SpringApplication attempts to create the right type of ApplicationContext on your behalf. The algorithm used to determine a WebAppli 阅读全文

posted @ 2018-12-31 10:13 手握太阳 阅读(161) 评论(0) 推荐(0) 编辑

Spring 梳理 - @Component

摘要: 使用@Component注解,表示该类定义为Spring管理Bean,使用默认value(可选)属性表示Bean标识符。如果不指定标识符,默认为首字母小写类名。例如类UserController的标识符为userController 阅读全文

posted @ 2018-12-31 09:52 手握太阳 阅读(136) 评论(0) 推荐(0) 编辑

Spring 梳理 - @Autowired VS @Resource

摘要: @Autowired顾名思义,就是自动装配,其作用是为了消除代码Java代码里面的getter/setter与bean属性中的property。当然,getter看个人需求,如果私有属性需要对外提供的话,应当予以保留。 这里@Autowired注解的意思就是,当Spring发现@Autowired注 阅读全文

posted @ 2018-12-31 09:49 手握太阳 阅读(293) 评论(0) 推荐(0) 编辑

2018年12月28日

Spring boot 官网学习笔记 - Spring Boot 属性配置和使用(转)-application.properties

摘要: Devtools global settings properties on your home directory (~/.spring-boot-devtools.properties when devtools is active). @TestPropertySource annotatio 阅读全文

posted @ 2018-12-28 22:31 手握太阳 阅读(509) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 ··· 24 下一页

导航