0
在意見文件夾kq.xml:Scala中使用XML處理髮揮框架
@(code:String)
<Response>
<Say voice="alice">
welcome
</Say>
<Pause length="1"/>
<Say loop="6" voice="alice" >
your conformation code is
<Pause length="1"/>
@code
</Say>
</Response>
在控制器:
def kqxml(code:String) = Action { implicit request =>
try {
Ok(views.xml.kq(code))
} catch {
case e: Exception =>
Ok(write(Map("result" -> "error")))
}
}
但得到錯誤:
object kq is not a member of package views.xml
[error] Ok(views.xml.kq(code))
^
我也試過:
Ok(views.html.kq(code))
哪個當然沒有用。