简体   繁体   English

Play框架无法识别play.libs.WS

[英]play.libs.WS not recognized in Play framework

I am using play.libs.WS in my application, but whenever I compile I get error that play.libs.WS is not resolved. 我在应用程序中使用play.libs.WS,但是每当我编译时,都会出现错误,指出play.libs.WS无法解决。 Can someone please help me out in this? 有人可以帮我吗?

Solved the issue. 解决了这个问题。 I had to include play_2.10.jar and play-datacommons_2.10.jar in my classpath. 我必须在类路径中包含play_2.10.jar和play-datacommons_2.10.jar。 Thanks everyone for devoting your time. 谢谢大家的投入。

You don't have to add jars manually one by one. 您不必一一手动添加罐子。

From docs : 文档

To use WS, first add javaWs to your build.sbt file: 要使用WS,请首先将javaWs添加到build.sbt文件中:

libraryDependencies ++= Seq(
  javaWs
)

And that's all. 就这样。

try the following imports in your controller 在您的控制器中尝试以下导入

import play.api.libs.ws.WS and import play.api.libs.ws._ 导入play.api.libs.ws.WS并导入play.api.libs.ws._

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM