Html 图像不';不能在服务器播放框架上工作
我对游戏中的图像有问题 这是我访问图像的方式Html 图像不';不能在服务器播放框架上工作,html,playframework,routes,Html,Playframework,Routes,我对游戏中的图像有问题 这是我访问图像的方式 src="@routes.Assets.at("/images/logo-mobile-control-white.png/")" 当我从本地访问时(localhost:9000),但当我从另一台计算机访问时(http://10.253.3.243:9000)图像不起作用 这是来自本地的代码 img src=“/assets//images/logo mobile control white.png/”width=“180”height=“60”b
src="@routes.Assets.at("/images/logo-mobile-control-white.png/")"
当我从本地访问时(localhost:9000
),但当我从另一台计算机访问时(http://10.253.3.243:9000
)图像不起作用
这是来自本地的代码
img src=“/assets//images/logo mobile control white.png/”width=“180”height=“60”border=“0”title=“mobile
控件“alt=”Logo Mobile
控制”
这是来自服务器的代码
img src=“/assets//images/logo mobile control white.png/”width=“180”height=“60”border=“0”title=“mobile control”alt=“logo mobile control”
照样
请帮帮我 简单地使用这个
src="@routes.Assets.at("images/logo-mobile-control-white.png")"
这将产生以下结果:
<image src="/assets/images/logo-mobile-control-white.png"/>
使用浏览器检查器-并比较两种情况下的html代码。。。我们猜不出哪里出了问题。您在html中使用了base
标记吗?从路径中删除前导和尾随斜杠?如果资源的路由默认定义为GET/assets/*file controllers.assets.at(path=“/public”,file),则正确
但我将我的路由定义为GET/images/*file controllers.Assets.at(path=“/public/images”,file)
因此在这种情况下,您需要以src=“@routes.Assets.at”(“/public/images”,logo mobile control white.png”)”的形式访问它。