Scala Play`@routes.Assets.versioned`导致非描述性错误
我有一个浏览器缓存问题,所以我决定改变Scala Play`@routes.Assets.versioned`导致非描述性错误,scala,playframework,Scala,Playframework,我有一个浏览器缓存问题,所以我决定改变 <script type="text/javascript" src="@routes.Assets.at("/accounts/dist/inline.bundle.js")"></script> 有什么想法吗?在src=“@routes.Assets.versioned(“/public/accounts/dist”,“inline.bundle.js”)” 为什么在versioned()中用逗号分隔两个字符串 这意味着您正在
<script type="text/javascript" src="@routes.Assets.at("/accounts/dist/inline.bundle.js")"></script>
有什么想法吗?在src=“@routes.Assets.versioned(“/public/accounts/dist”,“inline.bundle.js”)”
为什么在versioned()中用逗号分隔两个字符串
这意味着您正在给versioned()
两个参数,因此它会抛出一个错误,因为它只需要一个参数
相反,你应该这样给它-
src="@routes.Assets.versioned("/public/accounts/dist/inline.bundle.js")"
假设inline.bundle.js位于路径/public/accounts/dist/
试试这个,让我知道它是否有效。我希望是这样 在src=“@routes.Assets.versioned(“/public/accounts/dist”,“inline.bundle.js”)”
为什么在versioned()中用逗号分隔两个字符串
这意味着您正在给versioned()
两个参数,因此它会抛出一个错误,因为它只需要一个参数
相反,你应该这样给它-
src="@routes.Assets.versioned("/public/accounts/dist/inline.bundle.js")"
假设inline.bundle.js位于路径/public/accounts/dist/
试试这个,让我知道它是否有效。我希望是这样 在您的
路线定义中,您正在执行:
GET /assets/*file controllers.Assets.versioned(path = "/public/accounts/dist", file: Asset)
这意味着已定义了方法资产.versioned
的第一个参数(path=“/public/accounts/dist”
)。因此,您只能再容纳一个参数(资产文件)。但在你看来,你有:
<script type="text/javascript" src="@routes.Assets.versioned("/public/accounts/dist","inline.bundle.js")"></script>
在您的路线定义中,您正在执行:
GET /assets/*file controllers.Assets.versioned(path = "/public/accounts/dist", file: Asset)
这意味着已定义了方法资产.versioned
的第一个参数(path=“/public/accounts/dist”
)。因此,您只能再容纳一个参数(资产文件)。但在你看来,你有:
<script type="text/javascript" src="@routes.Assets.versioned("/public/accounts/dist","inline.bundle.js")"></script>
我正在传递两个参数,因为我们已经在其他两个项目中成功地实现了这一点。此外,路由文件在GET/assets/*file controllers.assets.versioned(path=“/public/accounts/dist”,file:Asset)”中有这一行,因此versioned可以使用2个参数。我已经尝试过将参数合并成一个字符串,就像与
一起使用一样-刚刚将处的替换为版本化的,但在编译时我遇到了“noSuchMethod+controllers.Reverseasets.versioned”错误。确切的错误是线程[application akka.actor.default-dispatcher-6]中的未捕获错误由于为ActorSystem[application]java.lang.NoSuchMethodError:controllers.ReverseAsets.versioned(Lcontrollers/Assets$Asset;)Lplay/api/mvc/Call启用了“akka.JVM退出致命错误”,正在关闭JVM代码>确定,尝试从版本控制中删除路由中已给定的路径。我的意思是,在路由中,您已将路径指定为/public/accounts/dist
,然后在代码中访问此部分时删除此部分。尝试使用-src=“@routes.Assets.versioned(“inline.bundle.js”)”
。我希望它能起作用!我正在传递两个参数,因为我们已经在其他两个项目中成功地实现了这一点。此外,路由文件在GET/assets/*file controllers.assets.versioned(path=“/public/accounts/dist”,file:Asset)”中有这一行,因此versioned可以使用2个参数。我已经尝试过将参数合并成一个字符串,就像与
一起使用一样-刚刚将处的替换为版本化的,但在编译时我遇到了“noSuchMethod+controllers.Reverseasets.versioned”错误。确切的错误是线程[application akka.actor.default-dispatcher-6]中的未捕获错误由于为ActorSystem[application]java.lang.NoSuchMethodError:controllers.ReverseAsets.versioned(Lcontrollers/Assets$Asset;)Lplay/api/mvc/Call启用了“akka.JVM退出致命错误”,正在关闭JVM代码>确定,尝试从版本控制中删除路由中已给定的路径。我的意思是,在路由中,您已将路径指定为/public/accounts/dist
,然后在代码中访问此部分时删除此部分。尝试使用-src=“@routes.Assets.versioned(“inline.bundle.js”)”
。我希望它能起作用!
<script type="text/javascript" src="@routes.Assets.versioned("inline.bundle.js")"></script>