• jsp获取spring容器
<%ServletContext sc = this.getServletConfig().getServletContext();ApplicationContext ac2 = WebApplicationContextUtils.getWebApplicationContext(sc);RedisService redisService=(RedisService)ac2.getBean("redisService");%>
  • service demo

@Service("redisService")