Changes for clojure.contrib.server-socket/create-repl-server

zkim on Sun, 26 Sep 2010
;; 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`
devijvers on Thu, 29 Jul 2010
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`:


    <listener>
        <listener-class>org.project.ReplServer</listener-class>
    </listener>


Once the web application is deployed connect to the REPL socket with this command:

`telnet yourserver 11111`