--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Very cool, I'm looking forward to diving into the new features!
--
Cheers,
√
——————
Viktor Klang
Deputy CTO
Typesafe Inc.
--
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scalaz.stream#scalaz-stream_2.10;0.7a: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] org.scalaz.stream:scalaz-stream_2.10:0.7a
[warn] +- org.specs2:specs2-common_2.10:3.4
[warn] +- org.specs2:specs2-matcher_2.10:3.4
[warn] +- org.specs2:specs2-core_2.10:3.4
[warn] +- org.specs2:specs2-mock_2.10:3.4
[warn] +- com.typesafe.play:play-specs2_2.10:2.4.0-RC1 (/Volumes/Home/j.ward/projects/webjars/webjars-play/build.sbt#L13-22)
[warn] +- org.webjars:webjars-play_2.10:2.4.0-M3-2-SNAPSHOT
resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"
--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-dev+unsub...@googlegroups.com.
Hi, I injected WSClient into my controller. I am getting a Null Pointer. Can i get the procedure of injecting WSClient into a controller?
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
object Authenticated extends ActionBuilder[Request] {the "service" instance never gets injected, and I end up with a nullpointer exception.
val logger = Logger(this.getClass)
val ACCESS_TOKEN_HEADER_KEY = "X-ACCESS-TOKEN"
@Inject() private var service: Service = null // blows up!
override def invokeBlock[A](request: Request[A], block: (Request[A]) => Future[Result]): Future[Result] = {
val requestToken = request.headers.get(ACCESS_TOKEN_HEADER_KEY)
requestToken match {
case Some(token) => {
// get token
service.getUserById(UUID.randomUUID())
// Do something
}
case _ => {
Future.successful(Forbidden("badd"))
}
}
}
}
class Authenticated @Inject() (service: Service) extends ActionBuilder[Request] {
val logger = Logger(this.getClass)
val ACCESS_TOKEN_HEADER_KEY = "X-ACCESS-TOKEN"
override def invokeBlock[A](request: Request[A], block: (Request[A]) => Future[Result]): Future[Result] = {
val requestToken = request.headers.get(ACCESS_TOKEN_HEADER_KEY)
requestToken match {
case Some(token) => {
// get token
service.getUserById(UUID.randomUUID())
// DO something
block(request)
}
case _ => {
Future.successful(Forbidden("badd"))
}
}
}
}
class Application @Inject()(authenticated: actions.Authenticated) extends Controller {
def profile = authenticated {
Ok("user profile")
}
}
--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
class UserActor @Inject()(service: Service) extends Actor { override def receive: Receive = { case SayHello(name: String) => sender() ! "Hello," + name } }
In my use-case I needed to, per request, create a new instance of my UserActor. To do that I needed to inject the Injector and use it as below:
val userActor = system.actorOf(Props(injector.instanceOf[UserActor]), name = userId.toString)Regards,
Hossein
Hi James,Thanks for your reply and clarification. What you explained raised some questions for me:1- If I go with non-DI approach, using the:private def service: Service = play.api.Play.current.injector.instanceOf[Service]
Will I get the same instance of Service as it is used everywhere else(as a singleton)?
2- If I go with the "correct approach" as I am doing now: I am injecting Service in to my AuthenticatedAction, and then injecting the AuthenticatedAction into my controller, while my controller has already is being injected with Service (I did not put this line in the example I showed you before). I have a Circle of dependencies. Isn't it bad practice?
Regarding what we can add to the documentation to help others, I was missing the piece about how to create an instance of an actor that is dependency injected:class UserActor @Inject()(service: Service) extends Actor { override def receive: Receive = { case SayHello(name: String) => sender() ! "Hello," + name } }
In my use-case I needed to, per request, create a new instance of my UserActor. To do that I needed to inject the Injector and use it as below:val userActor = system.actorOf(Props(injector.instanceOf[UserActor]), name = userId.toString)
scalaVersion := "2.11.5"
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
I’m updating the Silhouette to RC1 but i got problem with Crypto that is return different value
val json = """{"value":"value","expirationDate":1429928854718}""" val c1 = Crypto.encryptAES(json, "key") val c2 = Crypto.encryptAES(json, "key") println(c1 == c2) // false println(c1) // 2-Igr820+MvOvcloAi1acJEjOmaVzLOY1W/vp/CL0FR9NSVjhYvcQgmmf5bPcMlDNNkMFXZj0l5c6S+9kfytb0ig== println(c2) // 2-FYHyup0LrS0VcEWtDrZ3GajOJ3lueKBCAvG/NbjGDS6x+5O0Z9Q9d6wm28uScQKq9rAeO4yGA9vMQ828Z6ZMFA==
Any idea?
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
This is my pull request and it only fixes the documentation gap, not the issue itself on windows :/
The dominant error is:java.lang.NoSuchMethodError: play.PlayImport$PlayKeys$.playWatchService()Lsbt/SettingKey;It looks more like an issue that the signature of PlayKeys changed and an sbt-plugin (?) still tries to access the old key.
No, I don't know, how to solve it.
Have you solved the error? I have the same error./Johan
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
Have you solved the error? I have the same error.
/Johan
Den lördag 25 april 2015 kl. 12:06:03 UTC+2 skrev Grzegorz Slowikowski:
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
Hi, do you know when there will be a release version.
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Do you mean when 2.4.0 final is released? When we release an RC, and it has survived a week with no major issues raised against it, then 2.4.0 will be released.
I told my friend to delete the following directories/contents of these, and it worked for him:
~/.sbt/*