-
Notifications
You must be signed in to change notification settings - Fork 1
/
CleanUpController.java
48 lines (39 loc) · 1.31 KB
/
CleanUpController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.tadigital.servlet;
import java.io.IOException;
import java.sql.SQLException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.tadigital.dao.*;
/**
* Servlet implementation class CleanUpController
*/
@WebServlet("/CleanUpController")
public class CleanUpController extends HttpServlet {
private static final long serialVersionUID = 1L;
public CleanUpController() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
CleanUpDao cld = new CleanUpDao();
HttpSession session = request.getSession();
String status = null;
status = cld.deleteFileAndTable();
session.setAttribute("EXITSTATUS", status);
RequestDispatcher rd = request.getRequestDispatcher("index.jsp");
try {
rd.forward(request, response);
} catch (Exception e) {
System.out.println(e);
}
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}