⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bloglistener.java

📁 是一个网站的博客系统
💻 JAVA
字号:
package com.opensource.blog.web.servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

import com.opensource.blog.comm.*;




public class BlogListener
    extends HttpServlet implements ServletContextListener {

  //Notification that the web module is ready to process requests
  public void contextInitialized(ServletContextEvent sce) {
    String rootpath = sce.getServletContext().getRealPath("/");
    //System.out.println(sce.getServletContext().getServletContextName());
    if (rootpath != null) {
      rootpath = rootpath.replaceAll("\\\\", "/");
    }
    else {
      rootpath = "/";
    }
    Constant.ROOTPATH = rootpath;
  }

  //Notification that the servlet context is about to be shut down
  public void contextDestroyed(ServletContextEvent sce) {
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -