2

I have started using Clojure to build a web app (using ring and compojure) and everything is working fine with it.

However, when I use uberwar to create a war file and deploy it to Tomcat, my session is not visible to Tomcat.

The session mechanism itself is definitely working (it's preserving state for a shopping basket, for example) but there is no JSESSIONID and the Tomcat manager app, Java Melody, Psi Probe are all saying I have no sessions.

I'm sure there is something obvious I'm missing around creating the JSESSIONID, but I have not seen anything about this in any of the tutorials I have found.

Can someone point me towards an example of how a Clojure app deployed to a Tomcat server creates a JSESSIONID?

Thanks for any help

4

1 回答 1

2

Ring 使用自己的会话存储

但是,如果您使用的是 Servlet 容器,Ring 将使用各种 Servlet 对象填充请求映射。在这种情况下,:servlet-request键是指HttpServletRequest对象。

值得注意的是,Ring 是对 HTTP 的抽象,并不一定依赖于 Servlet 规范。因此,只要您在下面使用 Servlet 容器,您就应该能够使用您的 Servlet 会话

于 2013-07-03T13:38:25.677 回答