问题标签 [caveman2]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
168 浏览

common-lisp - 如何在 Caveman 中获取多个查询参数

我的代码在 REPL 中运行良好,但在我的 Web 应用程序中没有获得第二个值。

例如(?vehicle=bike&vehicle=car)

我试过的

当我做

  • CL-用户> (setf |vehicle| '(a b c)
  • CL-用户> (let ((|vehicle| (multival-plist:getf-all `(:|vehicle| ,|vehicle|) :|vehicle|))) (print (alexandria:flatten (list :vehicle |vehicle|))))

这会产生所需的输出(:VEHICLE A B C)

但是当我提交表格时

到我的路线

实际上我将结果渲染到 djula 模板,但是为了测试我使用format了。

结果只(VEHICLE (bike))检查了其中两个,导致

  • 自行车

我期望发生的事情

输出应该

  • 自行车

我将在我的应用程序中使用 16 个复选框,这将导致链接很长,任何建议使链接变短。

PS:我使用 Hunchentoot 服务器和 Caveman2 网络框架。