Skip to content

Instantly share code, notes, and snippets.

@llasram llasram/gist:3315099 forked from gtrak/gist:3314988
Created Aug 10, 2012

What would you like to do?
(defmacro make-servlet
"Call to generate a servlet class given the class name and a ring handler."
[servlet handler]
(let [servlet (name servlet), prefix (str servlet "-")]
`(do (println "Compiling Servlet" ~servlet)
(gen-class :name ~servlet
:prefix ~prefix
:extends javax.servlet.http.HttpServlet)
(s/defservice ~prefix ~handler))))
(defmacro make-servlets
[& servlets]
`(do ~(map #(list* `make-servlet %&) (partition 2 servlets))))
my.servlet.class.Servlet hr/app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.