Wesley13 Wesley13
3年前
java 随笔
Spring的scope"prototype"属性多例  spring默认scope是单例模式(singleton),这样只会创建一个Action对象,每次访问都是同一个Action对象,数据不安全。  struts2是要求每次次访问都对应不同的Action,scope"prototype"(多例)可以保证当有请求
Spring竟然可以创建“重复”名称的bean?—一次项目中存在多个bean名称重复问题的排查
众所周知,在Spring中时不能够创建两个名称相同的bean的,否则会在启动时报错:但是我却在我们的spring项目中发现了两个相同名称的bean,并且项目也可以正常启动,对应的bean也可以正常使用。
Wesley13 Wesley13
3年前
Java获取接口所有实现类的方式
<prestyle"color:orange"原作者:heaven夏链接:https://www.cnblogs.com/heaveneleven/p/9125228.html</pre有时候,根据业务逻辑的需求,我们想要获取到某个接口的所有实现类。在这里大致介绍两种方式:1\.借助Spring容器实现Spring作为一个
Stella981 Stella981
3年前
SpringBoot最最最常用的注解梳理
正文一、注解(annotations)列表@SpringBootApplication: 包含了@ComponentScan、@Configuration和@EnableAutoConfiguration注解。其中@ComponentScan让spring
Easter79 Easter79
3年前
SpringMVC源码阅读系列汇总
1.前言1.1导入SpringMVC是基于Servlet和Spring框架设计的Web框架,做JavaWeb的同学应该都知道!(https://oscimg.oschina.net/oscnet/0c6bfd66042ee7eff6e4aa69652e7c93a7f.png)本文基于Spring4.3.7源码分析,(不
Stella981 Stella981
3年前
Netty构建游戏服务器(三)
一,基本方法上节实现了netty的基本连接,这节加入spring来管理netty,由spring来开启netty服务。在netty服务器中,我们建立了三个类:HelloServer(程序主入口), HelloServerInitializer(传输通道初始化),HelloServerHandler(业务控制器)这三个类中Hello
Stella981 Stella981
3年前
Spring Boot踩坑笔记一:Spring Boot整合mybatis和通用Mapper遇到的坑
一、整合步骤1、添加启动依赖<!mybatis<dependency<groupIdorg.mybatis.spring.boot</groupId<artifactIdmybatisspringbootstarter</artifa
Easter79 Easter79
3年前
Springboot2整合Kafka
依赖<dependency<groupIdorg.springframework.kafka</groupId<artifactIdspringkafka</artifactId</dependency配置spring:kafka:bootstrapservers:外网ip:9092
Stella981 Stella981
3年前
Spring MVC 解读——View,ViewResolver
    上一篇文章(1)(http://my.oschina.net/HeliosFly/blog/212329)(2)(http://my.oschina.net/HeliosFly/blog/214438)分析了Spring是如何调用和执行控制器方法,以及处理返回结果的,现在我们就分析下Spring如何解析返回的结果生成响应的视图。一
Easter79 Easter79
3年前
SpringBoot最最最常用的注解梳理
正文一、注解(annotations)列表@SpringBootApplication: 包含了@ComponentScan、@Configuration和@EnableAutoConfiguration注解。其中@ComponentScan让spring