Attic/scala/Application0.scala
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 18 Nov 2014 03:27:16 +0000
changeset 315 7bd723cb9b32
parent 198 2ce98ee39990
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
103
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
package controllers
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
161
a0aebea668f9 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
     3
import play.api._
103
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
import play.api.mvc._
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
// hello world program: 
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
// just answer the GET request with a string
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
object Application extends Controller {
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
  // answering a GET request
161
a0aebea668f9 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    12
  def index = Action {
a0aebea668f9 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    13
    Ok(views.html.index("222Your new application is ready."))
a0aebea668f9 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 105
diff changeset
    14
    //Ok("Hello World")
103
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
  }  
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
  
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
}
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    19
/*
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    20
 * HTML can be returned using
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    21
 *
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    22
 * Ok("<H1>Hello world!</H1>").as(HTML)
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    23
 *
bd6e45c7aa8d added applications
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    24
 */