defservice

ring.util.servlet

  • (defservice handler)
  • (defservice prefix handler)
Defines a service method with an optional prefix suitable for being used by
genclass to compile a HttpServlet class.
e.g. (defservice my-handler)
(defservice "my-prefix-" my-handler)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source ring/util/servlet.clj:129 top

(defmacro defservice
  "Defines a service method with an optional prefix suitable for being used by
  genclass to compile a HttpServlet class.
  e.g. (defservice my-handler)
       (defservice \"my-prefix-\" my-handler)"
  ([handler]
   `(defservice "-" ~handler))
  ([prefix handler]
   `(defn ~(symbol (str prefix "service"))
      [servlet# request# response#]
      ((make-service-method ~handler)
         servlet# request# response#))))
Vars in ring.util.servlet/defservice: defmacro str symbol apply concat defn list seq vector
Used in 0 other vars

Comments top

No comments for defservice. Log in to add a comment.