`
MonsterDoctor
  • 浏览: 3361 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论
文章列表
最近在用springboot写一个项目,发现springboot确实比springMvc好用,通过各种配置就可以较少很多代码 但是在做的过程中,发现自己定义的拦截器在注入@Autowired   时不成功   @Autowired 下的接口类是null值。    经过查找,才知道拦截器加载的时间点在springcontext之前,所以在拦截器中注入才为null,这就是问题的原因。所以需要在配置文件中使用@Bean注解提前去加载。   最后在在添加到注册里面就可以了,再回去测试就发现成功注解上了      问题愉快解决!!!!!! 
1. 字符串有整型的相互转换  Java代码  1.String a = String.valueOf(2);   //integer to numeric string     2.int i = Integer.parseInt(a); //numeric string to an int   2. 向文件末尾添加内容  Java代码  1.BufferedWriter out = null;     2.try {     3.    out = new BufferedWriter(new FileWriter(”filename”, true));     4.    out.wri ...
Global site tag (gtag.js) - Google Analytics