is it possible to call java servlet from ring/compojure?
I have to call a servlet written in Java from Clojure web application, and I don't understand how to do that.
De开发者_开发百科veloping a webapp in Java, I had to describe all mappings in web.xml. In Compojure, I see, I must describe routes. So, can I bind the Java servlet to one such route?
Sorry if my question is stupid, but I've searched a lot and didn't find an answer; I'm just starting to develop for the web.
Two helpful pointers:
There's an example on how to generate the Vaadin servlet completely from Clojure on github
And here's a SO question on how to map a java filter to routes
I suggest, there is only one way to cope with my tasks. I have to manually instantiate Java servlets in Clojure web app and form their request and response parameters. Test package for ring.util.servlet library describes this approach in details, but in case of turning Ring handler into a Java servlet.
In case of deploying Clojure app and Java servlets to servlet container separately there's no need to define additional Compojure routes or Ring handlers to paths mapped by container.
Please tell me whether my suggestions are incorrect.
精彩评论