我使用Scalatra創建應用程序,我使用Scalate/Jade進行模板化。我嘗試將Flash支持添加到我的應用程序中。我將FlashMapSupport
混合到我的Servlet中,我可以訪問flash
幫助程序。無論如何,如果我試圖從佈局得到它,我收到以下錯誤:從Scalatra中的Jade模板訪問Flash地圖
[error] /home/ytaras/projects/scala/scalatra-shopping-cart/target/scala-2.10/src_managed/main/scalate/templates/layouts/default_jade.scala:27: not found: value flash
[error] flash.get("alert").foreach
[error] ^
[error] one error found
我可以做些什麼來避免這種情況是使用垂頭喪氣的渲染下,最佳的:
- context.asInstanceOf[org.scalatra.scalate.ScalatraRenderContext].flash.get("alert").foreach
- alert =>
.alert
.button(type="button" class="close" data-dismiss="alert") ×
= alert
無論如何,這是絕對不是最漂亮的解決方案。有什麼我可以做的,以解決它或這是一個問題在Scalate/Jade代碼?
你能否澄清哪些類型的信息可能有幫助?謝謝 – 2013-04-05 12:01:26
Hi Yura,你能像我做的那樣展示行動和觀點嗎?另外,如果您需要實時幫助,Freenode上的#scalatra irc頻道上有一個非常活躍的社區。 – futurechimp 2013-04-05 12:40:53
當然 - 這裏是我說的git倉庫 - https://github.com/ytaras/scalate_shopping_cart – 2013-04-05 13:08:24