package org.pinae.sarabi.service.handler;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ServletHandler extends HttpServlet {
	
	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
             throws ServletException, IOException {
		execute(request, response);
	}
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
		execute(request, response);
	}
	
	public void doHead(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
		execute(request, response);
	}
	
	public void doPut(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
		execute(request, response);
	}
	
	public void doDelete(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
		execute(request, response);
	}
	
	private void execute(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
		String method = request.getMethod(); 
	}
}

@@ -237,16 +237,114 @@
 ponse;%0A%0A
+import org.pinae.sarabi.service.ServiceConfig;%0Aimport org.pinae.sarabi.service.ServiceContainer;%0A%0A
 public c
@@ -436,16 +436,143 @@
 ID = 1L;
+%0A%09%0A%09private ServiceContainer container;%0A%09%0A%09public ServletHandler(ServiceContainer container) %7B%0A%09%09this.container = container;%0A%09%7D
 %0A%0A%09publi
@@ -1530,38 +1530,177 @@
 ing 
-method = request.getMethod(); 
+uri = request.getRequestURI();%0A%09%09String method = request.getMethod();%0A%09%09%0A%09%09ServiceConfig srvCfg = this.container.getService(uri, method);%0A%09%09if (srvCfg != null) %7B%0A%09%09%09%0A%09%09%7D
 %0A%09%7D%0A

Update ServletHandler