I'm trying to build a simple web site using Clojure / Compojure and want to feed apply a servlet filter to the request / response (i.e. a standard javax.servlet.Filter instance).
e.g. if the current source code is:
(defroutes my-app
(GET "/*"
(html [:h1 "Hello Foo!!"]))
)
I would like to add a filter like this:
(defroutes my-app
(GET "/*"
(FILTER my-filter-name
(html [:h1 "Hello Foo!!"])))
)
Where my-filter-name is some arbitrary instance of javax.servlet.Filter.
Any idea how to do this effectively and elegantly?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…