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 package org.utgenome.gwt.utgb.server;
26
27 import java.io.IOException;
28
29 import javax.servlet.ServletException;
30 import javax.servlet.http.HttpServlet;
31 import javax.servlet.http.HttpServletRequest;
32 import javax.servlet.http.HttpServletResponse;
33
34 import org.utgenome.UTGBException;
35
36
37
38
39
40
41
42 public abstract class RequestHandlerBase extends HttpServlet implements RequestHandler {
43
44
45
46 private static final long serialVersionUID = 1L;
47
48 public abstract void handle(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;
49
50 public void validate(HttpServletRequest request, HttpServletResponse response) throws ServletException, UTGBException {
51
52 }
53
54 @Override
55 protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
56 RequestDispatcher.setRequestParametersToHandler(this, req);
57 this.handle(req, resp);
58 }
59
60 @Override
61 protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
62 this.doGet(req, resp);
63 }
64
65 }