01: /**
02: * Copyright (C) 2006, 2007 David Bulmore, Software Sensation Inc.
03: * All Rights Reserved.
04: *
05: * This file is part of jWebApp.
06: *
07: * jWebApp is free software; you can redistribute it and/or modify it under
08: * the terms of the GNU General Public License (Version 2) as published by
09: * the Free Software Foundation.
10: *
11: * jWebApp is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with jWebApp; if not, write to the Free Software Foundation,
18: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19: */package jwebapp.controller;
20:
21: import java.io.IOException;
22: import javax.servlet.ServletConfig;
23: import javax.servlet.ServletException;
24: import javax.servlet.http.HttpServlet;
25: import javax.servlet.http.HttpServletRequest;
26: import javax.servlet.http.HttpServletResponse;
27:
28: /**
29: * Default servlet implementation. Use this class as the servlet class in your web.xml descriptor
30: */
31:
32: public class RequestServlet extends HttpServlet {
33: private static final long serialVersionUID = 100L;
34: private WebAppController requestController = new WebAppController();
35:
36: public void init(ServletConfig config) throws ServletException {
37: super .init(config);
38:
39: requestController.init(config);
40: }
41:
42: public void destroy() {
43: requestController.destroy();
44: }
45:
46: protected void doGet(HttpServletRequest request,
47: HttpServletResponse response) throws ServletException,
48: IOException {
49: requestController.processRequest(request, response);
50: }
51:
52: protected void doPost(HttpServletRequest request,
53: HttpServletResponse response) throws ServletException,
54: IOException {
55: requestController.processRequest(request, response);
56: }
57:
58: public String getServletInfo() {
59: return "Web Application Manager";
60: }
61: }
|