1 19 package org.netbeans.modules.exceptions.web; 20 21 import java.io.*; 22 import java.net.*; 23 import javax.servlet.*; 24 import javax.servlet.http.*; 25 26 31 public class IssuezillaRedirect extends HttpServlet { 32 33 public static final String ISSUEZILLA_ENTER_BUG = "http://www.netbeans.org/issues/enter_bug.cgi?"; 34 38 protected void processRequest(HttpServletRequest request, HttpServletResponse response) 39 throws ServletException, IOException { 40 41 Integer id = null; 42 try { 43 id = new Integer (request.getParameter("exceptionsid")); 44 } catch (NumberFormatException e) { 45 } 46 if (id != null) { 47 Object o = getServletContext().getAttribute("updater"); 48 if (o instanceof IssuezillaUpdater) { 49 IssuezillaUpdater updater = (IssuezillaUpdater) o; 50 updater.addIssue(id); 51 } 52 } 53 response.sendRedirect(ISSUEZILLA_ENTER_BUG + request.getQueryString()); 54 } 55 56 61 protected void doGet(HttpServletRequest request, HttpServletResponse response) 62 throws ServletException, IOException { 63 processRequest(request, response); 64 } 65 66 70 protected void doPost(HttpServletRequest request, HttpServletResponse response) 71 throws ServletException, IOException { 72 processRequest(request, response); 73 } 74 75 77 public String getServletInfo() { 78 return "Short description"; 79 } 80 } 82 | Popular Tags |