1 11 package org.eclipse.help.internal.webapp.servlet; 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 import org.eclipse.help.internal.base.BaseHelpSystem; 21 import org.eclipse.help.internal.webapp.data.WebappPreferences; 22 23 26 public class LiveHelpServlet extends HttpServlet { 27 private static final long serialVersionUID = 1L; 28 30 public void init() throws ServletException { 31 if (BaseHelpSystem.getMode() == BaseHelpSystem.MODE_INFOCENTER) { 32 throw new ServletException (); 33 } 34 } 35 36 40 protected void doGet(HttpServletRequest req, HttpServletResponse resp) 41 throws ServletException , IOException { 42 if (BaseHelpSystem.getMode() == BaseHelpSystem.MODE_INFOCENTER) { 43 return; 44 } 45 if (!new WebappPreferences().isActiveHelp()) { 46 return; 47 } 48 req.setCharacterEncoding("UTF-8"); String pluginID = req.getParameter("pluginID"); if (pluginID == null) 51 return; 52 String className = req.getParameter("class"); if (className == null) 54 return; 55 String arg = req.getParameter("arg"); BaseHelpSystem.runLiveHelp(pluginID, className, arg); 57 } 58 66 protected void doPost(HttpServletRequest req, HttpServletResponse resp) 67 throws ServletException , IOException { 68 doGet(req, resp); 69 } 70 } 71 | Popular Tags |