关于springboot:在jsp里-调用容器使用sevice

1次阅读

共计 258 个字符,预计需要花费 1 分钟才能阅读完成。

  • jsp 获取 spring 容器
<%

ServletContext sc = this.getServletConfig().getServletContext();
ApplicationContext ac2 = WebApplicationContextUtils.getWebApplicationContext(sc);

RedisService redisService=(RedisService)ac2.getBean("redisService");

%>
  • service demo

@Service(“redisService”)

正文完
 0