blob: c0e8d4196ccca33514603f4e2ddfcaa44352cbd2 (
plain) (
blame)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
|
/*******************************************************************************
* Copyright (c) 2000, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.help.internal.webapp.servlet;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.eclipse.help.internal.base.BaseHelpSystem;
/**
* Servlet to interface client with remote Eclipse
*/
public class ContentServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private EclipseConnector connector;
/**
*/
public void init() throws ServletException {
try {
connector = new EclipseConnector(getServletContext());
} catch (Throwable e) {
throw new ServletException(e);
}
}
/**
* Called by the server (via the <code>service</code> method) to allow a
* servlet to handle a GET request.
*/
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
req.setCharacterEncoding("UTF-8"); //$NON-NLS-1$
BaseHelpSystem.checkMode();
if (connector != null) {
connector.transfer(req, resp);
}
}
/**
*
* Called by the server (via the <code>service</code> method) to allow a
* servlet to handle a POST request.
*
* Handle the search requests,
*
*/
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
if (connector != null)
connector.transfer(req, resp);
}
}
|