diff -r 9c968d0de9a0 -r 2ce98ee39990 Attic/scala/app1.scala --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Attic/scala/app1.scala Sat Oct 04 13:17:18 2014 +0100 @@ -0,0 +1,26 @@ +object Application extends Controller { + + // GET request -> present login form + val index = Action { request => + + val form = + """
+ Login:
+ Password:
+
""" + + Ok(form).as(HTML) + } + + // POST data: processing the login data + val receive = Action { request => + + val form_data = Form(tuple ("login" -> text, "password" -> text)) + def (login, passwd) = form_data.bindFromRequest()(request).get + + Ok(s"Received login: $login and password: $passwd") + } +} + + +