;; Add a socket-based REPL to a web application.
;; First, generate a `ServletContextListener` implementation:
(use '[clojure.contrib.server-socket :only [create-repl-server]])
(gen-class
:name "org.project.ReplServer"
:implements [javax.servlet.ServletContextListener])
(defn -contextInitialized [this e]
(.start (Thread. (partial create-repl-server 11111))))
(defn -contextDestroyed [this e] )
;; Then, add this class to `web.xml`: org.project.ReplServer
;; Once the web application is deployed connect to the REPL socket with
;; this command: `telnet yourserver 11111`
;; Add a socket-based REPL to a web application.
;; First, generate a `ServletContextListener` implementation:
(use '[clojure.contrib.server-socket :only [create-repl-server]])
(gen-class
:name "org.project.ReplServer"
:implements [javax.servlet.ServletContextListener])
(defn -contextInitialized [this e]
(.start (Thread. (partial create-repl-server 11111))))
(defn -contextDestroyed [this e] )
;; Then, add this class to `web.xml`: org.project.ReplServer
;; Once the web application is deployed connect to the REPL socket with
;; this command: `telnet yourserver 11111`