📄 forumactionservlet.java
字号:
/*
* XP Forum
*
* Copyright (c) 2002-2003 RedSoft Group. All rights reserved.
*
*/
package org.redsoft.forum;
import javax.servlet.ServletException;
import javax.servlet.ServletContext;
import org.apache.struts.action.ActionServlet;
import org.redsoft.forum.dao.DAOFactory;
import org.redsoft.forum.search.ThreadSearcher;
import org.redsoft.forum.schedule.TaskRunner;
import org.redsoft.forum.schedule.BuildIndexTask;
/**
* The controller servlet extending ActionServlet
*
* @author <a href="mailto:jwtronics@yahoo.com">John Wong</a>
*
* @version $Id: ForumActionServlet.java,v 1.4 2003/08/01 09:28:33 cinc Exp $
*/
public class ForumActionServlet extends ActionServlet {
/**
* Forum control servlet init. Also init the DAOFactory. For MySQL, it set the data source
*/
public void init() throws ServletException {
super.init();
// init the factory, e.g. MySQL will get Data Source from ActionServlet
DAOFactory factory = DAOFactory.getInstance();
factory.init(findDataSource(null));
// build ForumDAO
ServletContext context = getServletContext();
factory.buildForumDAO( context.getRealPath(ForumConstants.FORUM_CONFIG_FILE) );
// init ThreadSearcher
ThreadSearcher.getInstance().init( context.getRealPath( ForumConstants.INDEX_DIR ) );
// init scheduled task
TaskRunner taskRunner = new TaskRunner();
taskRunner.addTask( new BuildIndexTask( context.getRealPath( ForumConstants.INDEX_DIR ) ) );
}
}//EOC
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -