我使用ring / compojure构建了一个Clojure Web应用程序。某些表单具有提供多个选择的输入。当使用jetty服务器在本地运行时,这些将按预期显示为:params
映射中的值向量,但是当部署到Tomcat时,只会显示其中一个选定值。
project.clj:
(defproject bconfig "0.0.1-SNAPSHOT"
:description "BConfig Web App"
:url "http://example.com/bconfig"
:dependencies [
[org.clojure/clojure "1.6.0"]
[compojure "1.1.8"]
[hiccup "1.0.5"]
[com.oracle/ojdbc6 "11.2.0.3"]
[org.clojure/java.jdbc "0.3.3"]
[cheshire "5.3.1"]
[clj-detector "0.0.2"]
[org.clojure/data.xml "0.0.7"]
[org.apache.commons/commons-compress "1.8.1"]
[digest "1.4.4"]
[net.sf.uadetector/uadetector-resources "2014.04"]
[org.flatland/ordered "1.5.2"]
[environ "0.5.0"]
[propertea "1.3.1"]
]
:plugins [
[lein-ring "0.8.11"]
[lein-environ "0.5.0"] ; ensures :env section below becomes available to environ.core/env
]
:ring {:handler bconfig.handler/app
:url-pattern "/"
:servlet-name "bconfig"
:web-xml "web.xml"
}
:repl-options {
;; If nREPL takes too long to load it may timeout,
;; increase this to wait longer before timing out.
;; Defaults to 30000 (30 seconds)
:timeout 120000
}
:profiles {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
[ring/ring-jetty-adapter "1.3.0"]
[ring-mock "0.1.5"]
]
:env {
}
:jvm-opts ["-Denv=dev" "-Ddevmode=y"]
:resource-paths ["resources" "resources/local"]
:source-paths ["src" "src/jetty"]
}
:deploydev
{:resource-paths ["resources" "resources/ldndsr000005176"]
}
}
)
来自handler.clj的片段:
(def app-routes (wrap-base-url the-routes))
(def app
(handler/site app-routes))
在RHEL上,Tomcat是6.0.24,servlet api版本为2.5。这个问题可能是什么?
答案 0 :(得分:1)
好的 - 可能是ring / jetty会解密到:params
中的向量而在tomcat下不是这样,但:multipart-params
总是正常。
使用来源,Luke