     (cons [method (parse-route route) resource]
           *resources*)))
 
+(def *default-resource*
+  (pseudo-servlet 
+    (str "Path: " full-path)))
+
 (defn find-resource
   "Find the first resource that matches the HttpServletRequest"
   [#^HttpServletRequest request response]

  '(method    (. request (getMethod))
    full-path (. request (getPathInfo))
    param    #(. request (getParameter %))
    header   #(. request (getHeader %))))

(defmacro pseudo-servlet
  "Create a pseudo-servlet from a resource. It's not quite a real
  servlet because it's a function, rather than an HttpServlet object."
  [resource]
  `(fn ~'[route context request response]
     (let ~(apply vector *resource-bindings*)
       (update-response ~'context ~'response (do ~@resource)))))

        (when (pos? len)
          (. out (write buffer 0 len))
          (recur (. in (read buffer))))))))

(def *default-mimetype* "application/octet-stream")

(defn context-mimetype
  "Get the mimetype of a filename using the ServletContext."
  [context filename]
  (or (. context (getMimeType filename))
      *default-mimetype*))

(defn re-escape
  "Escape all special regex chars in a string s."
