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

📄 crontabviewservlet.java

📁 jcrontab是一个定时器开源项目包 目前提供存取文件或数据库, 把执行结果寄发 email, 简单地设置在 Tomcat, Resin, Jetty 及 JBoss 之上, 更是可以取代 cron
💻 JAVA
字号:
/** *  This file is part of the jcrontab package *  Copyright (C) 2001-2003 Israel Olalla * *  This library is free software; you can redistribute it and/or *  modify it under the terms of the GNU Lesser General Public *  License as published by the Free Software Foundation; either *  version 2 of the License, or (at your option) any later version. * *  This library is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU *  Lesser General Public License for more details. * *  You should have received a copy of the GNU Lesser General Public *  License along with this library; if not, write to the Free *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, *  MA 02111-1307, USA * *  For questions, suggestions: * *  iolalla@yahoo.com * */package org.jcrontab.web;import javax.servlet.RequestDispatcher;import javax.servlet.ServletConfig;import javax.servlet.ServletContext;import javax.servlet.ServletRequest;import javax.servlet.ServletResponse;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.jcrontab.data.CrontabEntryBean;import org.jcrontab.data.CrontabEntryDAO;/** * This servlet is designed to put in the context the CrontabEntryBean * Necesary for the view. *  That's done that way cause it follow the MVC paradigm * @author $Author: iolalla $ * @version $Revision: 1.10 $ */public class CrontabViewServlet extends HttpServlet {        /** Refer to Servlet Javadoc         * @param request This is the servlet request.          * refer to the Servlet JavaDoc         * @param response This is the servlet response          * refer to the Servlet JavaDoc         */    		public void doPost(HttpServletRequest request,			HttpServletResponse response) {			doGet(request, response);		}        /** Refer to Servlet Javadoc         * @param request This is the servlet request.          * refer to the Servlet JavaDoc         * @param response This is the servlet response          * refer to the Servlet JavaDoc         */		public void doGet (HttpServletRequest request,    		       HttpServletResponse response) {       		try {					CrontabEntryBean[] listOfBeans= CrontabEntryDAO											.getInstance()											.findAll();			    			request.setAttribute ("listOfBeans", listOfBeans);    			getServletConfig().getServletContext()				.getRequestDispatcher("/CrontabView.jsp")				.forward(request, response);  		} catch (Exception ex) {	    		ex.printStackTrace ();    		}		}}

⌨️ 快捷键说明

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