1 11 package org.eclipse.help.internal.webapp.servlet; 12 13 import java.io.*; 14 15 import javax.servlet.*; 16 import javax.servlet.http.*; 17 20 public class ContentServlet extends HttpServlet { 21 private static final long serialVersionUID = 1L; 22 private EclipseConnector connector; 23 24 26 public void init() throws ServletException { 27 try { 28 connector = new EclipseConnector(getServletContext()); 29 } catch (Throwable e) { 30 throw new ServletException(e); 31 } 32 } 33 34 38 protected void doGet(HttpServletRequest req, HttpServletResponse resp) 39 throws ServletException, IOException { 40 req.setCharacterEncoding("UTF-8"); if (connector != null) { 42 connector.transfer(req, resp); 43 } 44 } 45 53 protected void doPost(HttpServletRequest req, HttpServletResponse resp) 54 throws ServletException, IOException { 55 if (connector != null) 56 connector.transfer(req, resp); 57 } 58 } 59 | Popular Tags |