簡體   English   中英

如何以編程方式解決Play框架路由沖突

[英]How to resolve Play framework routing conflicts programmatically

我在應用程序中定義了兩條路由。

GET /resource/:resourceid  ResourceController.getResourceById(resourceid : String)
GET /resource/system       SystemResourceController.getAllSystemResources()

以上路由相互沖突。

我無法訪問SystemResourceController中定義的getAllSystemResources()。

到/ resource / system的所有HTTP GET請求。 路由到/ resource /:resourceid

從以下鏈接的Play-framework文檔中: https://www.playframework.com/documentation/1.2.5/routes

我發現路由優先級基於路由文件中提到的路由順序。

無論如何,我能解決這個沖突嗎?

更改順序。 將/ resource / system的規則放在另一個規則之前

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM