                            ["-" (cons prefix routes)])]
     `(defn ~(symbol (str prefix "service"))
      ~'[this request response]
-       (http-service ~'[this request response]
+       (http-handler ~'[this request response]
          ~@routes))))

  [& routes]
  `(proxy [HttpServlet] []
     (service ~'[request response]
       (http-service ~'[this request response]
         ~@routes))))

(defmacro update-servlet
  "Update an existing servlet proxy with a new set of routes."
  [object & routes]
  `(update-proxy ~object
     {"service" (fn [this request response]
                  (http-service ~'[this request response]
                    ~@routes))}))

(defmacro defservlet

  HttpServletRequest instance."
  [[#^HttpServlet servlet, #^HttpServletRequest request] & body]
  `(let [~'context  (.getServletContext ~servlet)
         ~'method   (.getMethod   ~request)
         ~'url      (.getRequestURL ~request)
         ~'path     (.getPathInfo ~request)
         ~'params   (get-params   ~request)
         ~'headers  (get-headers  ~request)
         ~'mimetype (partial context-mimetype ~'context)
         ~'session  (get-session ~request)
         ~'cookies  (get-cookies ~request)]
