This works:
object Application extends Controller {
def index = Action {
Ok(<h1>hello world</h1>)
}
}
But I would have expected to need to write Ok("<h1>hello world</h1"), using quotation marks. Why isn't this necessary (from a Scala POV)?
Scala supports XML literals as a first-class part of the language: http://www.scala-lang.org/node/131. This is built in to the language and the choice of framework is irrelevant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With