java 代码

public class LoadTreeForXML implements ServletContextListener {
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        ServletContext servletContext = servletContextEvent.getServletContext();
        ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);

        //将数据放到缓存中。
        servletContext.setAttribute("allNotLeafNodeList", "AAAAAAAAAAAAAAAAAAA");
        servletContextEvent.getServletContext().removeAttribute("allNotLeafNodeList");
    }

    public void contextDestroyed(ServletContextEvent servletContextEvent) {
        System.out.println("关闭信息!");
    }

相关文章:

  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2021-11-23
  • 2021-10-02
  • 2021-08-08
  • 2021-08-02
猜你喜欢
  • 2022-02-20
  • 2021-12-04
  • 2022-03-03
  • 2021-09-17
相关资源
相似解决方案