Can't get javascriptRoutes to work with Play Framework 2

北战南征 提交于 2019-12-04 20:23:05

wrong order within the conf/routes file may cause the issue.

there is a hint:

http://grokbase.com/t/gg/play-framework/1348rbs2vk/2-1-scala-javascript-router-404

once I adjusted the order according to the hint:

Move the route definition of the javascript router action above the assets route.

the issue was fixed.

    # Routes
    # This file defines all application routes (Higher priority routes first)
    # ~~~~

    GET     /                           controllers.MainController.index()
    GET     /message                    controllers.MessageController.getMessage()
    GET     /assets/javascripts/routes  controllers.MessageController.javascriptRoutes()

    # Map static resources from the /public folder to the /assets URL path
    GET     /assets/*file               controllers.Assets.at(path="/public", file)
    GET     /webjars/*file              controllers.WebJarAssets.at(file)`
Istvano

In the meantime I have found an other post related to this ->

Unable to resolve reverse routing methods in IntelliJ

I had to remove some info from the project config to get the following folders to become part of source route ->

File -> Project Structure

Select Sources in Right Pane

Add Source folder target/scala-XXX/classes_managed target/scala-XXX/src_managed/main

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!