【问题标题】:play framework - Not found error for an existing route播放框架 - 未找到现有路线的错误
【发布时间】:2012-02-15 17:25:22
【问题描述】:

我正在使用 application.conf 中的 http.path 属性从不同的路径提供播放应用程序。所以在应用程序conf中,我有

http.path=/sales/

当我尝试访问 http://localhost:9000/sales/ 时,出现以下错误。

未找到 获取/销售/ 已按以下顺序尝试了这些路线: 1. GET /@documentation/cheatsheet/{category} PlayDocumentation.cheatSheet 2. GET /@documentation/modules/{module}/files/{name} PlayDocumentation.file 3. 获取 /@documentation/modules/{module}/images/{name} PlayDocumentation.image 4. GET /@documentation/modules/{module}/{id} PlayDocumentation.page 5. GET /@documentation/files/{name} PlayDocumentation.file 6. GET /@documentation/images/{name} PlayDocumentation.image 7. GET /@documentation/{id} PlayDocumentation.page 8. 获取/@文档/? PlayDocumentation.index 9. * /sales/ Application.index 10. 获取 /sales/login Secure.login 11. POST /sales/login Secure.authenticate 12. 获取 /sales/logout Secure.logout

注意:在我的路线文件中,我没有在路线前面加上“/sales”。它会自动添加到每条路线。

我不确定为什么“/sales/”路径无法识别。如果我提供路线“/sales/login”或任何其他路线,它可以工作。

附加信息:在安全模块中,我在两个地方进行了更改,将默认 URL 设置为“/sales/”而不是“/”。

变化是

flash.put("url",play.Play.configuration.get("http.path"));

url = String.valueOf(play.Play.configuration.get("http.path"));

【问题讨论】:

    标签: routes playframework


    【解决方案1】:

    从 http.path 设置中删除尾部斜杠

    http.path=/sales
    

    【讨论】:

    猜你喜欢
    • 2019-12-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-19
    相关资源
    最近更新 更多