Action composition in Play Framework

In Play Framework controllers consist of methods that create Action objects to handle the incoming requests. For example in the HelloController below the helloWorld and hello methods create actions that return a “hello” message to the client. In this case, the action objects are constructed using the apply factory method of the Action singleton object. […]

continue reading Action composition in Play Framework

Catching Throwable in Scala

Because of Scala‘s pattern matching syntax it is really convenient to catch Throwable instead of Exception or any other exception type. Instead of writing: try { iMayHaveIllegalState.doSomething() } catch { case e: IllegalStateException => e.printStackTrace() } we can simply write: try { iMayHaveIllegalState.doSomething() } catch { case e => e.printStackTrace() } You might be tempted […]

continue reading Catching Throwable in Scala