Play Framework Action Url

摘要:Play Framework Action Url

這次短短介紹,會用到的像是ASP的Response.redirect那樣的功能,在play的話會怎麼寫,

還有像.NET MVC 裡的View <%= Url.Action( new { Controller="Application",Action="Results",Query="index"}) %> 在 play的話會怎麼寫。

 

在Controller裡,

我目前頁面是Application/index的話,

我要在index頁面,直接轉到Application/main頁面的話,會怎麼轉,就只要直接在Controller,index方法中,直接呼叫main()方法就可以了。

-----------

若在View想要顯示某頁的連結,不用寫死的方式,而是用Controller及method就能自動幫你轉成實際的連結該怎麼做

就只要填寫@{Application.index()}及可。