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

📄 syslistener.java

📁 java论坛
💻 JAVA
字号:
package com.laoer.bbscs.web.servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
import com.laoer.bbscs.comm.*;

/**
 * <p>Title: Tianyi BBS</p>
 *
 * <p>Description: BBSCS</p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: Laoer.com</p>
 *
 * @author Gong Tianyi
 * @version 7.0
 */


public class SysListener
    extends HttpServlet implements ServletContextListener {

  private static final Log logger = LogFactory.getLog(SysListener.class);

  //Notification that the web module is ready to process requests
  public void contextInitialized(ServletContextEvent sce) {
    String rootpath = sce.getServletContext().getRealPath("/");
    if (rootpath != null) {
      rootpath = rootpath.replaceAll("\\\\", "/");
    }
    else {
      rootpath = "/";
    }
    if (!rootpath.endsWith("/")) {
      rootpath = rootpath + "/";
    }
    Constant.ROOTPATH = rootpath;
    logger.info("Application Run Path:" + 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 + -