1 30 31 package org.apache.commons.httpclient; 32 33 import java.io.IOException ; 34 35 import javax.servlet.ServletException ; 36 import javax.servlet.http.HttpServlet ; 37 import javax.servlet.http.HttpServletRequest ; 38 import javax.servlet.http.HttpServletResponse ; 39 40 public abstract class MultiMethodServlet extends HttpServlet { 41 protected abstract void genericService(HttpServletRequest request, HttpServletResponse response) throws IOException , ServletException ; 42 43 public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException , ServletException { 44 genericService(request,response); 45 } 46 47 public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException , ServletException { 48 genericService(request,response); 49 } 50 51 public void doDelete(HttpServletRequest request, HttpServletResponse response) throws IOException , ServletException { 52 genericService(request,response); 53 } 54 55 public void doPut(HttpServletRequest request, HttpServletResponse response) throws IOException , ServletException { 56 genericService(request,response); 57 } 58 } 59 60 | Popular Tags |