1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.http.server.glue;
12
13 import java.io.IOException;
14
15 import javax.servlet.ServletException;
16 import javax.servlet.http.HttpServlet;
17 import javax.servlet.http.HttpServletRequest;
18 import javax.servlet.http.HttpServletResponse;
19
20
21
22
23 public class ErrorServlet extends HttpServlet {
24 private static final long serialVersionUID = 1L;
25
26 private final int status;
27
28
29
30
31
32
33
34 public ErrorServlet(int status) {
35 this.status = status;
36 }
37
38
39 @Override
40 protected void doGet(HttpServletRequest req, HttpServletResponse rsp)
41 throws ServletException, IOException {
42 rsp.sendError(status);
43 }
44 }