SPRING中用websocket,无法实例化,注入bean为null
摘要:解决方案:改为静态变量 private static PostingsHandlerOnlineServiceI postingsHandlerOnlineService; @Autowired public void setIAppChatService(PostingsHandlerOnline
阅读全文
posted @
2021-02-24 09:37
减肥少年
阅读(299)
推荐(0)
Spring代码实例化参考
摘要:1、、 LogisticsDao logisticsDao=(LogisticsDao)SpringContextHolder.getApplicationContext().getBean("logisticsDao"); 2、 SysDeptAPI sysDeptApi=(SysDeptAPI)
阅读全文
posted @
2019-01-21 15:38
减肥少年
阅读(227)
推荐(0)
token验证,如果验证失败,抛出自定义异常,返回结果固定格式
摘要:spring-mvc.xml 切面类 只是满足条件后,抛出异常 TokenExceptionResolver类
阅读全文
posted @
2018-06-11 16:09
减肥少年
阅读(3620)
推荐(0)
spring aop拦截相关设置
摘要:如果AOP无法拦截,可参考我另一篇《springmvc+spring架构,aop无法拦截解决方案》 注解拦截方法 @annotation 例如:expression="@annotation(com.xxx.common.fitter.Token)" 注解拦截类下所有方法 @within 例如:ex
阅读全文
posted @
2018-06-11 15:59
减肥少年
阅读(369)
推荐(0)
springmvc+spring架构,aop无法拦截解决方案
摘要:项目是springmvc+spring,发现只能拦截dao层里方法 Service层不拦截将导致无法进行事务管理 Service层不拦截原因:springmvc的配置文件及spring的配置文件同时扫描了service,就无效了 Service层不拦截解决方案:将springmvc配置文件里将ser
阅读全文
posted @
2018-05-08 17:05
减肥少年
阅读(1542)
推荐(0)
spring事务配置无效问题解决
摘要:项目使用spring+springmvc+mybatis,配置完之后发现事务没起作用,捣鼓了几乎一个白天。 废话不多说,首先发现切面几乎没起作用,只有mapper能被切到,servicce层切不到。 最后的解决方案是,springmvc和spring是两个配置文件,修改spring-mvc.xml的
阅读全文
posted @
2018-04-25 09:34
减肥少年
阅读(246)
推荐(0)