问题描述
在舞台模式下运行Play框架应用时遇到问题.
I've got a problem running my Play framework app on stage mode.
如果我以开发人员模式运行应用程序(例如,以play run
表示),则一切正常.如果我使用play compile clean stage
编译应用程序,然后使用start
,则我的所有资产都无法访问(出现404错误).
If I run the app on dev mode, with play run
for instance, everything is ok.If I compile the app with play compile clean stage
, and then use start
, all my assets are unreachable (I get a 404 error).
我知道有关空文件的错误/功能,但实际上并非如此.
I'm aware of the bug/feature about empty files, but that's actually not the case here.
我的路线与文档相同:
GET /assets/*file controllers.Assets.at(path="/public", file)
有人可以帮助我吗?谢谢!
Can anybody help me ?Thanks !
推荐答案
实际上听起来像Play Framework能够在开发人员模式下(但不是在阶段中)使用路径中的//
获取文件.
Actually sounds like Play Framework is able to get files with //
in the path in dev mode, but not in stage.
因此,这应该适用于开发人员模式:
So this should works on dev mode:
assets//images/image.png
但不在舞台模式下.要解决此问题,只需将//
替换为/
But not in stage mode.To correct this, just replace //
with /
这篇关于在舞台模式下播放资产时出现框架404错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!