public class test extends HttpServlet {
   public void doGet (
     HttpServletRequest req,
     HttpServletResponse res) throws ServletException,IOException {
     ....}
//注意,这儿是实现可以调用doPost的方法
   public void doPodt(
     HttpServletRequest req,
     HttpServletResponse res) throws ServletException,IOException {
     doGet((HttpServletRequest)req,(HttpServletResponse)res);}
     }