(defn get-session-handler [^org.eclipse.jetty.server.session.SessionHandler session-handler](let [session-listener (reify javax.servlet.http.HttpSessionListener(sessionCreated [this event](println (str "sessionCreated CALLED: " event))(swap! sessions ƒ(conj % (.getSession event))))(sessionDestroyed [this event](println (str "sessionDestroyed CALLED: " event))(swap! sessions (λ [sess](remove ƒ(= (.getId (.getSession event))(.getId sess))sess)))));; i) this is the main attempt;; session-manager (org.eclipse.jetty.server.session.HashSessionManager.); ;session-handler (org.eclipse.jetty.server.session.SessionHandler. session-manager);; ii) this replaces i)_ (.addEventListener session-handler session-listener)]session-handler))
2. Unhandled clojure.lang.Compiler$CompilerExceptionError compiling:/home/twashing/Projects/codepair.io/src/clj/codepair/http/server.clj:16:501. Caused by java.lang.NullPointerException(No message)util.clj: 26 codepair.http.util/get-session-handlerservice.clj: 86 codepair.http.service/fnjetty.clj: 123 io.pedestal.http.jetty/create-serverjetty.clj: 140 io.pedestal.http.jetty/serverVar.java: 383 clojure.lang.Var/invokehttp.clj: 262 io.pedestal.http/serverhttp.clj: 276 io.pedestal.http/create-serverserver.clj: 20 codepair.http.server/eval20659
You should look at the second link again. It illustrates the use of a the `context-configurator`, which gives you direct access to the ServletContextHandler. In that example, I'm using the context-configurator to add a ServletFilter, but you can do anything with it. It's just a function that is passed a single argument, the context.- PaulOn Wed, Mar 18, 2015 at 11:35 PM, Timothy Washington <twas...@gmail.com> wrote:The first link is definitely what I need. And I can definitely reify a SessionListener (my-session-listener) with sessionCreated and sessionDestroyed methods. However, I don't have access to the context (ServletContextHandler). Thus I can't invoke the below.context.setHandler(sessionHandler);sessionHandler.addEventListener(my-session-listener);And the second link is good direction for adding a filter. But what I need in this case is a session listener.
--
You received this message because you are subscribed to the Google Groups "pedestal-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pedestal-user...@googlegroups.com.
Visit this group at http://groups.google.com/group/pedestal-users.