📄 mvnforumcontextlistener.java
字号:
package com.mvnforum;
import javax.servlet.*;
import org.apache.commons.logging.*;
import net.myvietnam.mvncore.util.FileUtil;
public class MVNForumContextListener implements ServletContextListener {
private static Log log = LogFactory.getLog(MVNForumContextListener.class);
/**
* The servlet context with which we are associated.
*/
private ServletContext context = null;
public MVNForumContextListener() {
}
/**
* Notification that the web application is ready to process requests.
*
* @param event ServletContextEvent
*/
public void contextInitialized(ServletContextEvent event) {
log.debug("contextInitialized");
this.context = event.getServletContext();
String realPath = context.getRealPath("/WEB-INF/classes");// Add '/' before WEB-INF to fix the Oracle 10G bug
FileUtil.setServletClassesPath(realPath);
}
/**
* Notification that the servlet context is about to be shut down.
*
* @param event ServletContextEvent
*/
public void contextDestroyed(ServletContextEvent event) {
log.debug("contextDestroyed");
this.context = null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -