GPServlet.java 508 B

12345678910111213141516171819
  1. package cn.hhj.http;
  2. public abstract class GPServlet {
  3. public void service(GPRequest request,GPResponse response) throws Exception{
  4. //由service方法来决定,是调用doGet或者调用doPost
  5. if("GET".equalsIgnoreCase(request.getMethod())){
  6. doGet(request, response);
  7. }else{
  8. doPost(request, response);
  9. }
  10. }
  11. public abstract void doGet(GPRequest request,GPResponse response) throws Exception;
  12. public abstract void doPost(GPRequest request,GPResponse response) throws Exception;
  13. }