0
我試圖按照「介紹Play框架」中的示例進行操作。我已經部署了工作至今這裏如何整理以下Play Framework路由?
http://vivid-beach-8523.herokuapp.com/
當我做例如iPad上搜索它的「亂」 URL出現
http://vivid-beach-8523.herokuapp.com/search?search=ipad&submit=Search
我認爲我正確地有路由設置(在conf /路由),因爲當我使用'乾淨'的網址時,它提出了正確的結果
http://vivid-beach-8523.herokuapp.com/search/IPad
我不確定如何讓我的表單顯示乾淨的URL。原始的HTML是
<div id="searchdiv">
<form action="@{Application.search()}" method="GET">
<input type="text" id="search" name="search" />
<input type="submit" id="submit" name="submit" value="Search" />
</form>
</div>
Application.search如下
public static void search(String search, Integer page) {
if (page == null) page = 1;
SearchResults results = AuctionItem.search(search, page);
render(results, page, search);
}
任何幫助的,我需要改變大加讚賞的東西。在需要的情況下,路線文件看起來像以下
GET /listing/create Application.createAuctionItem
POST /listing/create Application.doCreateItem
GET /listing/show/{id} Application.show
GET /listing/show Application.show
GET /search/{search} Application.search
GET /search Application.search
GET / Application.index
順便說一句,()的Application.search參數的數量不匹配的形式。這可能是另一個問題 – dwi2 2012-01-13 06:43:18