--- a/app1.scala Mon Sep 24 20:51:17 2012 +0100
+++ b/app1.scala Tue Sep 25 01:32:01 2012 +0100
@@ -1,18 +1,18 @@
object Application extends Controller {
- // presenting login form
+ // GET request -> present login form
val index = Action { request =>
- val form = """<form method="post">
- Login: <input type="text" name="login"><br>
- Password: <input type="password" name="password"><br>
- <input type="submit"></form>"""
+ val form =
+ """<form method="post">
+ Login: <input type="text" name="login"><br>
+ Password: <input type="password" name="password"><br>
+ <input type="submit"></form>"""
Ok(form).as(HTML)
}
-
- // processing the received login data
+ // POST data: processing the login data
val receive = Action { request =>
val form_data = Form (tuple ("login" -> text, "password" -> text))
@@ -21,7 +21,6 @@
Ok("Received login: " + login + " and password: " + password)
}
-
}