score:1
consider essentialaction
which by-design does not have a body parser like so
def findperson(name: string) =
essentialaction { _ =>
people.find(_.name == name) match {
case some(person) => accumulator.done(ok(json.tojson(person)))
case none => accumulator.done(notfound(s"no person named $name"))
}
}
or actionbuilder.ignoringbody()
like so
val ignoringbodyaction = new actionbuilder.ignoringbody()(executioncontext)
def findperson(name: string) =
ignoringbodyaction {
people.find(_.name == name) match {
case some(person) => ok(json.tojson(person))
case none => notfound(s"no person named $name")
}
}
Source: stackoverflow.com
Related Query
- How can an action convey that it has no body using a type?
- How can I specify that a class passed in a type parameter has a certain companion object?
- How to declare scala method so that it can be called from Java using varargs style
- scala: how to create a generic type which is subtype of all the number classes in scala so that it can include compare method
- How can I improve Scala's type inference with type parameters that don't show up in the first parameter list?
- How to initialize empty map that has been type aliased
- How to union two spark Dataframe with a field of type struct that can differ?
- How can I customize Scala ambiguous implicit errors when using shapeless type inequalities
- How can I ensure that the dynamic type of my custom Scala collection is preserved during a map()?
- How to create a Scala function that can parametrically create instances of sub-types of some type
- How to assure that some type has a specific member
- How can I create a generic list monoid in scala that maintains the inner type of the list involved?
- How to bind a class that extends a Trait with a monadic type parameter using Scala Guice?
- How to do non specialized type has method that accepts Function1?
- Using the Scala type system to flexibly assert that a base class has some combination of additional properties
- How can I create an additional ExecutionContext that has similar properties to ExecutionContext.global?
- What are the way/s of telling scala compiler that type TableQuery[T] can map to somthing has the attribute id
- How to un-nest a spark rdd that has the following type ((String, scala.collection.immutable.Map[String,scala.collection.immutable.Map[String,Int]]))
- How can I check that method parameters have the same type as the methods this?
- How to call a function that has a Map with a Generic Type as a parameter
- SCALA: How to Construct a composite Type That can accept any of Int, Long or BigInt implicitly
- How can I create a different entity type using the original entity id in sorm?
- How can I make a scala method parameter type that is a collection of multiple types that can be converted to a given type?
- using duck typing to create mixins in Scala, can i decorate existing methods in a class that has no 'knowledge' of the mixin trait?
- How can I handle errors using ActionBuilder, and Action composition?
- Scala: How can I create a function that has multiple possible return types? (given this edge case inside)
- How can I bring ad-hoc polymorphism using type classes or implicit classes into parameterized context at runtime?
- How to create a Scala executable jar file that is built with Maven, and has log4j included, using IntelliJ IDEA IDE
- How to define a type parameter that can be either a type or a container for that type?
- How can I test this custom Action that extends ActionBuilder?
More Query from same tag
- Unpacking tuple types in Scala
- java.lang.ClassNotFoundException: net.logstash.logback.encoder.LogstashEncoder
- How to convert a Scala Array[Byte] to Java byte[]?
- Async version of AuthenticatedBuilder in play 2
- How much of a jar file gets loaded into the memory
- How to generate avro ocf format(with schema) data/file using scala?
- Return Future Message from an Actor
- MongoDB countDocuments() very slow in Scala as compared to MongoDB Compass
- EMR Spark Fails to Save Dataframe to S3
- minBy equivalent in Spark Dataframe
- Parsing with scala-xml API with multiple attributes
- extract string with regex in scala
- Scalacheck Try: Monadic Associativity law passes with generated functions
- Avoiding nested Ifs when working with multiple Options and Eithers
- False "Combinational loop detected"
- How to apply user-defined function to column (gives "Task not serializable" when adding a column)?
- How to handle comma in a cell in csv file in Spark/Scala
- scala.bat run simple scala program in windows 7 64bit
- Is there an efficient way to avoid repeated evaluation with mapValues?
- Scala 2.10-M1 and 2.9 same time on Devel Machine?
- Execute cmd in scala with space char in s3 path
- akka-sbt-plugin specifying outputDirectory in build.sbt
- Elegant map implementation
- spark rank - scala based one second and third elemnts of tuple of RDD
- Scala play framework and NIO.2
- create dataset from 2 other datasets spark
- Play framework 2: implicit values in view
- Spark scala dynamically create filter condition value from sequence Pair
- How to create an immutable map/set from a seq?
- Get multiple results for PL/SQL decalred variable from scala