Clojure

运行于 JVM 上的 Lisp 方言

Clojure 上描述 Clojure “健壮、实用、快速、简单、一致、强大”

logo

hello, world

1
(println "hello, world")

Web

  • ring
1
2
3
4
5
6
7
8
9
10
11
(defn shiro-body
[handler request]
(let [subject (build-subject request)
session-before (.getSession subject false)
response (.execute (build-callable))
session-after (.getSession (sec-util/get-subject))]
(if (and (not session-before) session-after)
(assoc-in response [:cookies :JSESSIONID] (create-cookie (.getId session-after)))
(if (and (session-before) (not session-after))
(assoc-in response [:cookies :JSESSIONID] (create-cookie (.getId session-after) :http-only false :max-age 0))
response))))
Edit on GitHub