我正在将我的应用程序从 play 2.0.4 迁移到 play 2.1.0。Play 2.1 无法识别视图中的 flash、会话或请求,导致编译错误
如何在 play-2.1.0 中表示来自 play-2.0.4 的以下代码
A、闪光
@if(flash.contains("success")) {
<p class="success">@flash.get("success")</p>
}
B.会话 -----
@if(nav == "signup" && session.get("sitetype")=="public")
C. 请求
var chatSocket = new WS("@routes.Chat.chat(username).webSocketURL(request)")
错误日志
[error] /Users/abhijitbasu/SampleApps/smartex-app/app/views/chatRoom.scala.html:120: not found: value request
[error] var chatSocket = new WS("@routes.Chat.chat(username).webSocketURL(request)")
[error] ^
^
[error] /Users/abhijitbasu/SampleApps/smartex-app/app/views/login.scala.html:16: not found: value flash
[error] @if(flash.contains("success")) {
[error] ^
[error] /Users/abhijitbasu/SampleApps/smartex-app/app/views/main.scala.html:159: not found: value session
[error] @if(nav == "signup" && session.get("sitetype")=="public") {
[error] ^
[error] /Users/abhijitbasu/SampleApps/smartex-app/app/views/mediainsight.scala.html:109: not found: value session
[error] ajaxpage(rootdomain+'@routes.Chat.chatRoom(session.get("firstname") + ' ' + session.get("lastname"))', 'contentarea')
[error] ^
[error] /Users/abhijitbasu/SampleApps/smartex-app/app/views/signup/form.scala.html:39: not found: value flash
[error] <p class="error">@flash.get("error")</p>
非常感谢您的帮助。