動態

詳情 返回 返回

在jsp裏, 調用容器,使用sevice - 動態 詳情

  • jsp獲取spring容器
<%

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

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

%>
  • service demo

@Service("redisService")

Add a new 評論

Some HTML is okay.