![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring
love13135816
这个作者很懒,什么都没留下…
展开
-
spring4 注解 添加ContentNegotiatingViewResolver
创建 ContentNegotiatingViewResolverpackage spittr.config;import java.nio.charset.Charset;import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;im原创 2017-04-28 15:46:02 · 670 阅读 · 0 评论 -
spring4 集成JMX监控
单机监控在javaconfig类中开启注解@EnableMBeanExport或者 在传统的xml中添加<context:mbean-export server="mbeanServer" />来看看如何使用注解吧@ManagedResource 将MBeanController导出为MBean@ManagedAttribute 将bean的方法暴露为MBean托管操作@ManagedOperati原创 2017-05-18 16:55:17 · 4240 阅读 · 0 评论 -
spring4 集成WebSocket
首先创建接收消息器public class MarcoHandler extends AbstractWebSocketHandler { private Logger log = LoggerFactory.getLogger(MarcoHandler.class); @Override protected void handleTextMessage(W原创 2017-05-09 19:38:57 · 731 阅读 · 0 评论 -
spring4
maven 的pox.xml3.0.6.RELEASE org.thymeleaf thymeleaf ${thymeleaf.version} org.thymeleaf thymeleaf-spring4 ${thymeleaf.version} org.thymeleaf.extras原创 2017-05-18 10:34:56 · 355 阅读 · 0 评论 -
spring JUnit测试
@RunWith(SpringJUnit4ClassRunner.class) 启用Spring测试环境 @ContextConfiguration(classes={RootConfig.class}) 加载配置文件类 @ContextConfiguration(locations = { “classpath*:/application-config.xml” }) 加载XML配置文件类原创 2017-04-27 09:49:57 · 286 阅读 · 0 评论 -
spring4 注解开启JAX-WS
用注解搭建了下 JAX-WS ,特记录下重点原创 2017-04-27 09:30:27 · 476 阅读 · 0 评论 -
spring4 发送email
首先,配置邮件发送器 @Bean public MailSender mailSender(){ JavaMailSenderImpl mailSender = new JavaMailSenderImpl(); mailSender.setHost("服务"); mailSender.setPort(端口);原创 2017-05-17 15:25:19 · 506 阅读 · 0 评论 -
用javaConfig注解创建spring 工程的基本配置
最近刚看了spring实战第四部 自己也用javaconfig的方式创建了一个简单的web工程 记录下心得首先用javaconfig创建spring web工程的时候 还是是否简单的 只需要继承AbstractAnnotationConfigDispatcherServletInitializer的实现接可以public class SpittrWebAppInitializer ext原创 2017-04-15 14:39:01 · 2478 阅读 · 0 评论 -
spring4 集成STOMP
pom.xml需要添加部分 org.springframework spring-messaging ${spring-framework.version} io.projectreactor reactor-core 2.0.4.RELEASE io.projectreactor reactor-net原创 2017-05-16 14:23:13 · 377 阅读 · 0 评论 -
Spring4 注解方式开启缓存
可以采用单缓存 或者 多缓存单独开启ehcache 或 redis @Configuration@EnableCachingpublic class CachingCinfig {// @Bean// public CacheManager cacheManager(){// return new ConcurrentMapCacheManager()原创 2017-04-24 16:20:25 · 2165 阅读 · 0 评论 -
spring4 Security注解保护方法
@Configuration/** * * @EnableGlobalMethodSecurity(securedEnabled=true) * 开启@Secured 注解过滤权限 * * @EnableGlobalMethodSecurity(jsr250Enabled=true) * 开启@RolesAllowed 注解过滤权限 * * @EnableGlobalMet原创 2017-04-24 17:02:34 · 1964 阅读 · 0 评论 -
spring4 注解方式集成redis
@Configurationpublic class RedisConfig { @Autowired private Environment env; @Bean public RedisConnectionFactory redisCF() { JedisConnectionFactory cf = new JedisConnectionFa原创 2017-04-24 16:17:13 · 1538 阅读 · 0 评论 -
spring4 注解方式集成mongoDB
@EnableMongoRepositories 开启mongomongo的最简单配置@Configuration@EnableMongoRepositories(basePackages = "spittr.mongo")public class MongoConfig extends AbstractMongoConfiguration { @Autowire原创 2017-04-24 16:07:38 · 3276 阅读 · 0 评论 -
spring4 ActiveMQ
Maven 导入ActiveMQ 5.11.0 org.apache.activemq activemq-all ${activemq.version} org.springframework spring-jms ${spring-framework.version}ActiveMQ的配置文件<beans xmlns="http://www.spring原创 2017-05-04 17:00:13 · 598 阅读 · 0 评论 -
spring 4 注解方式添加数据源
@EnableTransactionManagement 开启事情注解@EnableJpaRepositories 开启jpa @Configurable@EnableTransactionManagement@EnableJpaRepositories(basePackages="spittr.repository",includeFilters={@ComponentScan.原创 2017-04-17 15:31:00 · 1310 阅读 · 0 评论 -
Security4 的自定义token登陆
基于注解方式的Security 自定义 token登陆首先是 Security的配置必须基础AbstractSecurityWebApplicationInitializerpublic class SecurityWebInitializer extends AbstractSecurityWebApplicationInitializer {}然后是配置原创 2017-04-17 09:29:29 · 837 阅读 · 0 评论 -
SpringBoot 优雅停服
pom.xml 引用 actuator 监控插件<!-- springboot监控 --><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId><...原创 2018-04-13 18:36:11 · 1256 阅读 · 1 评论